Skip to content

Support/workaround for raw little-endian RGBA5551 images? #8547

Answered by radarhere
applecuckoo asked this question in Q&A
Discussion options

You must be logged in to vote

there's only a big-endian raw_mode for RGBA5551 available

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?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@applecuckoo
Comment options

@Yay295
Comment options

Answer selected by applecuckoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants