Support/workaround for raw little-endian RGBA5551 images? #8547
-
Hi! I'm currently working on a decoder for a niche texture format. I'm currently using For reference, I've attached a raw 256x256 file and what it should look like. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Do you mean that you are using the "RGBA;15" unpacker, but rather than RRRRRGGGGGBBBBBA, you would like an unpacker for ABBBBBGGGGGRRRRR? If you're after an immediate solution, I would suggest just reversing the information in your own code first, before passing it to Pillow. As far as your example goes, I tried running from PIL import Image
with open("10.dat", "rb") as fp:
Image.frombytes("RGBA", (512, 512), fp.read(), "raw", "RGBA;15") but received "ValueError: not enough image data", so maybe you're doing something different? Could you provide some code to demonstrate what you're currently doing, and what you'd like to do? |
Beta Was this translation helpful? Give feedback.
Do you mean that you are using the "RGBA;15" unpacker, but rather than RRRRRGGGGGBBBBBA, you would like an unpacker for ABBBBBGGGGGRRRRR? If you're after an immediate solution, I would suggest just reversing the information in your own code first, before passing it to Pillow.
As far as your example goes, I tried running
but received "ValueError: not enough image data", so maybe you're doing something different?
Could you provide some code to demonstrate what you're currently doing, and what you'd like to do?