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

Improve indexed to grayscale conversion #674

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

andrews05
Copy link
Collaborator

@andrews05 andrews05 commented Jan 29, 2025

If no palette reduction occurred (or palette reductions were off), a fully transparent palette entry may not have been zeroed to black. By ensuring this gets cleaned in the indexed_to_channels transformation, we may able to achieve a grayscale conversion that would otherwise have been RGB.

This is the final piece of the puzzle in #649 to achieve better file sizes on the first run and avoid further changes on a second run.

Results from the images in #649 (combining this PR and #673):
9.1.3 1st run: 2,191,773
9.1.3 2nd run: 2,191,629
PR 1st run: 2,191,380
PR 2nd run: 2,191,380

Copy link
Collaborator

@AlexTMjugador AlexTMjugador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome catch! 👍

@AlexTMjugador AlexTMjugador merged commit 174f36a into shssoichiro:master Feb 2, 2025
12 checks passed
@andrews05 andrews05 deleted the indexed_to_grayscale branch February 3, 2025 03:13
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