I have a PNG image with a black shape on transparent background. I need a white shape on a solid black background instead.
How can I achieve that with Imagemagick?
Image example:
I have this:
I want this:
Might be able to simply extract the alpha channel to a new image.
For example, let's create a transparent image.
convert -size 100x100 xc:transparent -fill black -draw 'circle 50,50 50,10' transparent.png
Now we can extract the alpha channel knowing that fully transparent is black, and opaque is white.
convert transparent.png -alpha extract output.png