Commit Graph

32 Commits

Author SHA1 Message Date
4ccd9cbfbc Merge pull request #832 from trigger337/fix/dds-png-stage-cleanup
dds_png: restore write mode before unlink on replace failure in main (DDS-PNG-STAGE-CLEANUP)
2026-11-29 19:36:37 +01:00
21ba178e97 Merge pull request #2248 from kirigayakazima/codex/dds-png-bc6h-preview
dds_png: preview signed and unsigned BC6H textures
2026-11-29 00:48:31 +01:00
d73adc4b16 Merge pull request #2249 from kirigayakazima/codex/dds-png-bounded-scanlines
dds_png: compress scanlines without staging the entire image
2026-11-28 20:31:39 +01:00
7811fd88cb dds_png: preview signed and unsigned BC6H textures 2026-11-27 19:57:35 +08:00
a9ec081f12 dds_png: compress scanlines without staging the entire image 2026-11-26 18:14:40 +08:00
9797ec66a1 dds_png: pick the BC4/BC5 SNORM ramp from the stored endpoints (DDS-PNG-SNORM-MODE)
_bc_interp_lut_snorm clamped a -128 endpoint to -127 before the red_0 > red_1
test. D3D's BC4_SNORM rule compares the stored int8 endpoints and reads -128
as -127 only as a value (DirectXTex and Pillow decode it that way), so the
pair 0x81, 0x80 (-127 > -128) is an eight-value block with every entry -1.0.
The clamp made the endpoints equal, took the six-value ramp, and index 7
decoded to +1.0 (255) instead of 0. It is the only one of the 65,536 pairs
whose ramp changes.

Tested: new test_snorm_ramp_is_chosen_by_the_raw_endpoints (BC4S and BC5S,
fails before the fix); all 65,536 BC5_SNORM endpoint pairs x 8 indices match
Pillow 12.3 within 1 (one 255-off mismatch before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 20:44:21 +01:00
b5dd9acbb6 dds_png: restore write mode before unlink on replace failure in main (DDS-PNG-STAGE-CLEANUP)
When previewing/saving PNG in CLI main(), if os.replace fails after
shutil.copymode set the destination's permissions, resetting os.chmod to
0o600 ensures TemporaryDirectory cleanup does not fail with PermissionError
on Windows if the output was read-only.

agent: yes
AI-assisted: yes
2026-11-24 17:21:01 +03:00
c495e11841 Publish DDS preview PNGs only after a complete write (#6909)
Squash-merged after diff review of PR #6909 - dds_png: preserve existing previews when an output write fails
2026-11-23 09:47:21 -06:00
956544023a Preview individual DDS mip levels, cube faces, array layers and volume slices (#6352)
Squash-merged after review of PR #6352 - Preview individual DDS mip levels, cube faces, array layers and volume slices
2026-11-23 08:16:00 -06:00
ff181e07c8 Merge pull request #3863 from inerthel-agi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:01 -05:00
5fdcf31720 fix(textures): filter sRGB DDS previews in linear light
Carry the DXGI transfer function through alpha-weighted preview resizing. Keep RGBA8 quantization stable on dark ties and cover the PNG bytes for tagged and untagged textures (BUILD-1087).
2026-11-22 23:06:02 +01:00
8c47721b77 Merge pull request #3183 from jaybeebabageyus 2026-11-22 17:00:50 -05:00
0a0e206a3c dds_png: decode legacy 24-bit BGR/RGB DDS layouts
tools/dds_png.py rejected every DDPF_RGB header with rgb_bit_count != 32,
so legacy D3DFMT_R8G8B8 (24-bit BGR) textures failed PNG preview and
batch_glb material-input conversion with 'Unsupported uncompressed RGB
bit count: 24'. Accept 24- and 32-bit RGB headers; 24-bit payloads decode
byte-aligned 8-bit lanes per the header masks with row-pitch padding
removed and opaque alpha. Non-canonical 24-bit bitmask layouts are still
rejected. Tests: Rgb24Tests in tests/test_dds_png.py (header/decode,
RGB8 byte order, padded rows, zero-alpha-mask flag, pitch/truncation
errors, unsupported layouts, PNG round trip); the non-32-bit rejection
test now checks 8/16-bit counts.
2026-11-22 21:50:30 +01:00
3b29aea72e Merge pull request #2687 from Vonsek 2026-11-22 15:11:23 -05:00
5115e0b1cc Merge pull request #2476 from Vonsek 2026-11-22 13:15:35 -05:00
0aaa35f596 Merge pull request #2446 from FreddyxS 2026-11-22 13:15:22 -05:00
f66ae36b03 Merge pull request #2403 from Julio Facal 2026-11-22 13:15:03 -05:00
884b4750d5 merge: preserve upstream changes alongside the asset fix 2026-11-22 19:08:46 +01:00
d79c044474 fix(tools): preview R11G11B10 float DDS textures
The texture exporter writes DXGI 26 DDS files, but the PNG converter lacked a decoder for their packed unsigned-float channels.
2026-11-22 18:51:47 +01:00
62804d0d01 fix(tools): weight DDS preview colors by alpha when resizing
A transparent texel can contain arbitrary RGB bytes. Giving those bytes equal weight introduces visible fringes in the resized PNG.
2026-11-22 18:10:21 +01:00
f7217c22ac test(dds): cover packed 10-bit pixels and padded rows 2026-11-22 18:01:10 +01:00
72ccb827dd DDS: decode legacy DXT2 and DXT4 with straight alpha 2026-11-22 13:55:55 -03:00
e45bcce4b0 Merge pull request #2223 from FreddyxS 2026-11-22 11:43:05 -05:00
7086d5b50b test(dds): cover DX10 typeless byte layouts 2026-11-22 17:20:30 +01:00
bf0f1de815 dds_png: unpremultiply DX10 alpha before PNG export 2026-11-22 15:49:48 +00:00
77e9ce9f2c dds_png.py: include odd edges when box-downscaling previews 2026-11-22 12:19:45 +01:00
ee21f60afd dds_png: refuse to overwrite the source texture 2026-11-22 04:50:51 -03:00
fa866b43f8 Decode standard BC7 DDS textures in offline world previews 2026-11-21 21:03:55 -07:00
dc216b739e tests/test_dds_png.py: test negative max_size rejection 2026-11-22 01:32:24 +00:00
8b884e475b Cover padded DDS rows with custom masks 2026-11-22 00:33:31 +01:00
1e0f5a7fad Cover padded DDS rows and invalid pitch values 2026-11-22 00:09:04 +01:00
aa2febee17 tests: cover the stdlib DDS decoder with synthetic buffers
dds_png.py had no tests, so header parsing, the BC block decoders and the
PNG writer were only ever checked by eye. These cases pin the exact pixel
output of BC1, BC2, BC3, BC4 and BC5 against hand-computed values, plus
the uncompressed swizzles, the box-filter downscaler and the PNG chunks.
2026-11-21 20:24:54 +00:00