Workbench

Note to Self: ImageMagick Edition

(Or, things I am perpetually looking up how to do with ImageMagick)

Notes refer to the ImageMagick 7 magick command-line tool unless otherwise noted.

Generate a Limited Palette From a Source Image

magick <input.png> -colors 64 -unique-colors -scale 1000% <palette.png>

Scale is not necessary if you're just using the palette file for quantization, but it's nice to be able to actually see the colors.

(via Stackexchange)

Apply a Limited Color Palette to an Image

magick <input.png> -remap <palette.png> <output.png>

If you want the resulting image to include a smaller number of colors while still restricting those colors to the palette:

magick <input.png> -remap <palette.png> -colors <n> <output.png>

Tue Dec 02 2025 19:00:00 GMT-0500 (Eastern Standard Time)