Make conv of grays to different level of transp faster

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Make conv of grays to different level of transp faster

Post by fmw42 »

try

convert image.png \( +clone -contrast-stretch 0 \) +matte -compose copy_opacity -composite result.png

+clone copies your image to use for the alpha channel
-contrast-stretch 0 will make your alpha channel graylevels become 0 to 255
-compose copy_opacity -composite will add the alpha channel to the image
Post Reply