Skip to content

Fixed color palette dithering to preserve PLTE chunk#7

Merged
ikraamg merged 1 commit intomainfrom
fix-colour-pallete-dithering
Jan 7, 2026
Merged

Fixed color palette dithering to preserve PLTE chunk#7
ikraamg merged 1 commit intomainfrom
fix-colour-pallete-dithering

Conversation

@ikraamg
Copy link
Copy Markdown
Collaborator

@ikraamg ikraamg commented Jan 7, 2026

Refactored palette creation to use ImageMagick's mpr: (memory program register) instead of temp files, eliminating file I/O and cleanup issues.

Key fixes:

  • Skip png:exclude-chunks for color palettes (was removing PLTE chunk)
  • Apply saturation boost BEFORE normalize (order matters)
  • Skip strip() for color palettes (was corrupting colormap)
  • Enable normalize + saturationBoost by default for color palettes

Also extracted streamToBuffer() and configureOutputFormat() utilities to reduce duplication across processing functions.

@claude

This comment was marked as outdated.

@ikraamg ikraamg force-pushed the fix-colour-pallete-dithering branch from 6948fb0 to 8dd39d0 Compare January 7, 2026 16:03
@claude

This comment has been minimized.

@ikraamg ikraamg force-pushed the fix-colour-pallete-dithering branch 3 times, most recently from 166b622 to 32a88ee Compare January 7, 2026 16:19
@claude

This comment was marked as resolved.

@claude

This comment was marked as resolved.

Refactored palette creation to use ImageMagick's mpr: (memory program
register) instead of temp files, eliminating file I/O and cleanup issues.

Key fixes:
- Skip png:exclude-chunks for color palettes (was removing PLTE chunk)
- Apply saturation boost BEFORE normalize (order matters)
- Skip strip() for color palettes (was corrupting colormap)
- Enable normalize + saturationBoost by default for color palettes

Also extracted streamToBuffer() and configureOutputFormat() utilities
to reduce duplication across processing functions.
@ikraamg ikraamg force-pushed the fix-colour-pallete-dithering branch from 32a88ee to ff5f7a8 Compare January 7, 2026 16:25
@ikraamg ikraamg merged commit d2dfc74 into main Jan 7, 2026
8 checks passed
@ikraamg ikraamg mentioned this pull request Jan 7, 2026
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.

1 participant