Skip to content

Improve indexed to grayscale conversion#674

Merged
AlexTMjugador merged 1 commit intooxipng:masterfrom
andrews05:indexed_to_grayscale
Feb 2, 2025
Merged

Improve indexed to grayscale conversion#674
AlexTMjugador merged 1 commit intooxipng:masterfrom
andrews05:indexed_to_grayscale

Conversation

@andrews05
Copy link
Copy Markdown
Member

@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
Copy Markdown
Member

@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 oxipng:master Feb 2, 2025
@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