How to create a background image using transparency

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
birdienumnum

How to create a background image using transparency

Post by birdienumnum »

Hi i am new to Imagemagick.

I wish to convert a JPG image and make this suitable as a background image i.e an image that can appear behind text in the foreground. I know this is probably related to adding a transparency layer to the original image and that a JPG image file may need to be converted to a PNG or some other image type that support a transparency layer. However, I am not sure of the commands in Imagemagick to do this. Can someone help - I may be completely on the wrong path already? I want the new background image to be around 25% faded from the original JPG image. I have some example image files but only locally on my PC i.e not on the web. I could supply these if this helps.

Thank you all in advance.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to create a background image using transparency

Post by anthony »

Your request is a little confusing.
I wish to convert a JPG image and make this suitable as a background image i.e an image that can appear behind text in the foreground.
This clear enough but then...

If the JPG image is a background and place behind your text, why would to need to give it transparency?

Any transparency would be in the foreground image so that the background appears where ever the foreground is transparent?

The final background is typically left fully-opaque, with only the overlay images containing transparency.

Perhaps an example would explain further.


If you are just wanting to 'dim' your background with soem color, why not merge in a specific color like 'black' or 'white' using -colorize
http://www.imagemagick.org/Usage/color/#colorize

You can also give the text overlay a fuzzy border, so that it 'dims' the background immediatally around it.
See Labeling on top of the image itself...
http://www.imagemagick.org/Usage/annotating/#anno_on

The compound Font examples can also help here.
http://www.imagemagick.org/Usage/fonts/ ... ft_outline

Remember any color can be used for the font and the 'outline' color.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
birdienumnum

Re: How to create a background image using transparency

Post by birdienumnum »

Thank you Anthony.

Your first link had the solution I was looking for. Also, I now understand what a transparency is and when to use. Sorry for the confusion!
Post Reply