brendan-duncan / image

Dart Image Library for opening, manipulating, and saving various different image file formats.
MIT License
1.18k stars 268 forks source link

Rgb565 #630

Open paraflu opened 7 months ago

paraflu commented 7 months ago

I'm not very knowledgeable in image management and I discovered the rgb565 format. I have an image RGB565 serialized with an rle compression, I've decoded byte per byte from and to rgb888 with many shift of bit and pixel by pixel. Now I was better looking the library and I was looking for some rgb888 to rgb856 format conversion but I can't find it. Is supposed I have to write my encoder/decoder? Should be useful for your lib?

From where I can start to develop the enc/dec?

Thanks for all your work

brendan-duncan commented 7 months ago

Rgb565 is ok for file size, but it has pretty niche usage. Not many apps will support it, it will almost always expand to rgb888 in memory, it's not great for compression, and there are not many existing image formats that will support it. There is a variant of BMP that can store Rgb565, but not many programs will support it.

So I'm not sure how useful having a custom image format for rgb565 in this library would be. It would likely have a single user, you. Which isn't a bad thing, but I'm not sure it would be worth the technical debt to add a custom format. If you want to add Rgb565 to the BMP encoder/decoder, that might not be so bad.