Skip to main content
edited title
Link

ImageMagick: How do I define a colour as the first in the indexed colour map when using -kmeans?

Source Link

How do I define a colour as the first in the indexed colour map when using -kmeans?

I need a specific colour to be the first in the colour map when using -kmeans to reduce the amount of colours in an image. It's required by Unreal Engine 1 textures when defining a mask colour.

This is all I've got so far:

magick "$PNG_FILE" -kmeans 255 "$PCX_FILE" 

I can somewhat accomplish it using the -define kmeans:seed-colors="#ff00ff" directive, but it worsens the output too much, as it prevents the seed colours from being sampled automatically.