Page 1 of 1

transparency; IM & carthographie

Posted: 2007-12-13T04:16:08-07:00
by paul
I started using ImageMagick 2 days ago (ImageMagick 6.2.4 10/02/07 ). I am a very newbie.
My needs are working with images (png and eps) generated from GRASS (http://grass.itc.it/).
My question:
how can I get a fully transparent png image?
With the command:

Code: Select all

convert -transparent red base.png pippo.png
only red color is made transparent.
How can I set every colors transparent (all image)? Is there any way to get an image with a percentage of transparency ?
Does anyone know where can I find examples of IM usage in cartography?

Many thanks in advance.

Re: transparency; IM & carthographie

Posted: 2007-12-13T05:44:56-07:00
by Bonzo
I do not know what your final image needs to be but if you want to overlay your transparent png onto another image you can use:

Code: Select all

composite -dissolve 30% original.png background.jpg output.jpg
An example but tiling the png over the image.
Image

You can use -watermark but that converts your png to grayscale.

Re: transparency; IM & carthographie

Posted: 2007-12-16T21:02:14-07:00
by anthony
Both dissolve and blend can make the whole image semi-transparent. Can by adjusting the parameters you don't need to overlay it onto another image. See IM Examples on Blend for an example.
http://imagemagick.org/Usage/compose/#blend_use

For partical transparency, you will need to extract and adjust the mask of an image. A grey scale value in a mask is semi-transparent!
http://imagemagick.org/Usage/channels/#erase

For selecting more colors than pure red, you would use a -fuzz factor,
http://imagemagick.org/Usage/color/#fuzz

Re: transparency; IM & carthographie

Posted: 2007-12-18T01:41:49-07:00
by paul
Hi

Bonzo, Anthony many thanks for your answers.

Paul