Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Palette is BGR and not RGB in PNG_PIXEL_INDEXED #19

Open
Raphael-Boichot opened this issue Nov 28, 2024 · 2 comments
Open

Palette is BGR and not RGB in PNG_PIXEL_INDEXED #19

Raphael-Boichot opened this issue Nov 28, 2024 · 2 comments

Comments

@Raphael-Boichot
Copy link
Contributor

Raphael-Boichot commented Nov 28, 2024

Hello.

All is in the title, here are 3 images with their palette from example code:

{0,0,0,0,255,0}
{0,0,0,255,0,0}
{0,0,0,0,0,255}

Red is blue and blue is red.
This is not documented so I guess this is an issue.

Raphaël

@bitbank2
Copy link
Owner

The color order can be confusing, especially since I didn't create an explicit palette structure with names for the indexed colors. I don't plan on changing the code, but documenting it would be helpful. Where do you think it should be mentioned?

@Raphael-Boichot
Copy link
Contributor Author

Hello and thanks for your response.

Maybe something like this in the wiki:

PNG_PIXEL_GRAYSCALE - 8-bpp grayscale
PNG_PIXEL_TRUECOLOR - 24-bpp (8x3) RGB triplets
PNG_PIXEL_INDEXED - 1 to 8-bpp BGR triplets
PNG_PIXEL_GRAY_ALPHA - 16-bpp (8-bit gray + 8-bit alpha)
PNG_PIXEL_TRUECOLOR_ALPHA - 32-bpp (RGB8888)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants