fading greyscale image proportionally

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
panta
Posts: 2
Joined: 2011-04-19T19:26:08-07:00
Authentication code: 8675308

fading greyscale image proportionally

Post by panta »

Hi there!

I've a grayscale image that would like to turn into transparent, as follows:
White --> fully transparent
Black --> fully opaque
and everything in the middle should be proportionally turned into transparent.

I tried replacing white with transparent (even using -fuzz) but it doesn't achieve what I want.

Ideas?

thanks!
panta
Posts: 2
Joined: 2011-04-19T19:26:08-07:00
Authentication code: 8675308

Re: fading greyscale image proportionally

Post by panta »

Ah, never mind, I found a seimilar:

viewtopic.php?f=1&t=17526&hilit=transparent
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: fading greyscale image proportionally

Post by anthony »

convert mask_image -negate -background black -alpha shape shape_image

See Masks as Colored Shapes
http://www.imagemagick.org/Usage/masking/#shapes

The use of -alpha shape was added AFTER that specific discusion.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply