transparency; IM & carthographie

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
paul

transparency; IM & carthographie

Post 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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: transparency; IM & carthographie

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: transparency; IM & carthographie

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
paul

Re: transparency; IM & carthographie

Post by paul »

Hi

Bonzo, Anthony many thanks for your answers.

Paul
Post Reply