Repository navigation
Use raw codec for reading uncompressed BGR and BGRA DDS - #10376
Conversation
Merging this PR will improve performance by ×4301 warning
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
| masks = struct.unpack(f"<{mask_count}I", header[84 : 84 + mask_count * 4]) | ||
| self.tile = [ImageFile._Tile("dds_rgb", args=(bitcount, masks))] | ||
| return | ||
| if masks == (0xFF0000, 0x00FF00, 0x0000FF): |
There was a problem hiding this comment.
I think we need
| if masks == (0xFF0000, 0x00FF00, 0x0000FF): | |
| if bitcount == 24 and masks == (0xFF0000, 0x00FF00, 0x0000FF): |
to take RGBX files into account.
There was a problem hiding this comment.
Are you able to find a sample RGBX file?
There was a problem hiding this comment.
I can synthesize one from Hopper?
Extracted from #9943
When it added support for arbitrary masks for uncompressed RGB DDS data, #7589 removed the use of the raw codecs for existing masks. This restores them, so that the faster raw codec is used.