alpine-alpaca / asefile

Library for loading Aseprite files. Directly reads binary Aseprite files and does not require you to export files to JSON.
MIT License
43 stars 15 forks source link

Add support for reading old color palette chunks #13

Closed KeyboardDanni closed 2 years ago

KeyboardDanni commented 2 years ago

If an indexed image is saved in Aseprite and it has a palette with exactly 256 colors with no alpha in any of them, only the old palette chunk (0x0004) is saved into the file. This makes those files fail to parse in asefile. This adds logic to parse the old palette chunks so that such files will load properly.

alpine-alpaca commented 2 years ago

Thanks for the PR! Looks good.

The 6 -> 8 bit upscaling wasn't clear to me, at first. I understand it now, but it's not obvious. I'll add a comment and then put it in the next release.

KeyboardDanni commented 2 years ago

Yeah, it's the same bit shifting logic used by Aseprite itself, so I just wanted to make sure it was consistent.