Skip to content

Instantly share code, notes, and snippets.

@softworkz
Created September 24, 2021 23:08
Show Gist options
  • Save softworkz/deef5c2a43d3d629c3e17f9e21544a8f to your computer and use it in GitHub Desktop.
Save softworkz/deef5c2a43d3d629c3e17f9e21544a8f to your computer and use it in GitHub Desktop.
Color Palette Quantization in Photoshop

Here's an example regarding the image color quantization I've been talking about.

This is an original subtitle bitmap having a palette of 4 or 5 colors:

@softworkz
Copy link
Author

ELBG Filter (to 8-bit alpha palette)

ffmpeg -y -loglevel verbose -i "..\fate-suite\apng\o_sample.png" -filter_complex "elbg=pal8=1" -frames:v 1 out.png

image

ELBG with new Alpha-Patch (to 8-bit alpha palette)

ffmpeg -y -loglevel verbose -i "..\fate-suite\apng\o_sample.png" -filter_complex "elbg=pal8=1:use_alpha=1" -frames:v 1 out.png

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment