Say I have a PNG with transparent pixels, how could I translate them to a solid color?
(Note this is slightly different to this question as I'm looking to replace with an arbitrary color. White is "special" in ImageMagick, as the accepted answer there indicates by the fact it omits to mention white).
You can invert the colours on your device to a make it easier to read by enabling the Colour Inversion setting. This will increase The contrast between text, images and the background. Often this means the text will become white text over a black background.
Select Start > Settings > Personalization > Colors, and then choose your own color, or let Windows pull an accent color from your background.
CSS allows you to invert the color of an HTML element by using the invert() CSS function that you can pass to the filter property. Because the default color of the text is black, the color is inverted into white with filter: invert(100%) syntax.
For me, the following works (ImageMagick 6.6.3-1):
convert in.png -background "#FF0000" -flatten out.png
Just swap the red color to whatever suits your needs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With