Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Hi all,
I have a transparent png file and I want to replace an existing opaque colour (eg. #000) with a transparent rgba colour (eg. rgba(255, 0, 0, 50.0)). Is it possible?
I spent days without result.
Here the command I use:
try reading the input first, then use opaque black. Also alpha is specified in the range of 0 to 1, not 0 to 100 or 0 to 255. So if you want 50% transparent use 0.5
Your image is totally black with a binary alpha channel. So one way is to make it totally red with an alpha channel reduced by 50%. This works for me on IM 6.9.9.8 Q16 Mac OSX. Change my path to your path to your sRGB.icc profile
convert img_black.png -alpha off -fill red -opaque black -alpha on -channel a -evaluate multiply 0.5 +channel -profile /Users/fred/images/profiles/sRGB.icc image_red_half_alpha.png
This also works. Add -channel rgba from my earlier suggested command.