I'm using -kmeans to reduce some images from true RGB to 256 colours, for use in Unreal Engine 1. In order to have transparency in those textures, I need to use a magenta mask colour (#ff00ff).
The problem is that the images I'm converting are antialiased, so they contain steps between the true magenta and other colours, resulting in pink pixels around the masked area. I cannot change the source images to prevent this antialiasing.
My idea is then to reduce a range of magenta-ish colours to true magenta. (example) How would I go about this?
This is my command so far. I also need to place the magenta as the first colour in the index, which this does, but it worsens the quality of the output significantly:
magick "$PNG_FILE" -define kmeans:seed-colors="#ff00ff" -kmeans 255 "$PCX_FILE"


