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

😁(NewQuant): add color_map_alpha for the tRNS chunk in the PNG format #23

Merged
merged 1 commit into from
May 2, 2024

Conversation

W-Mai
Copy link
Contributor

@W-Mai W-Mai commented May 1, 2024

It's useful for transparency used in the tRNS chunk of the PNG format.

When writing PNG, the alpha channel and the RGB channel are separate, and the alpha channel is in the tRNS chunk.

S0, it's useful in this case.

@W-Mai W-Mai changed the title 😁(NewQuant): add color_map_alpha for the tRNS trunc in the PNG format 😁(NewQuant): add color_map_alpha for the tRNS chunk in the PNG format May 1, 2024
@kornelski
Copy link
Contributor

It won't hurt to add this, but I'm not sure if it's useful.

In PNG there's a micro-optimization: put transparent colors first, so that tRNS can be shorter than the palette. So you'd probably rather get RGBA colors out of it, sort them, and then build palette and tRNS.

@kornelski kornelski merged commit 0a8f644 into image-rs:master May 2, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants