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?".
nasaa1
Posts: 3 Joined: 2013-06-11T02:03:16-07:00
Authentication code: 6789
Post
by nasaa1 » 2013-06-13T08:20:07-07:00
Hi,
I have this image -
http://postimg.org/image/xmlwkmec5/f5325cd6/
I was wondering if I can hide the transparency or give a white background to only selected area and not the whole image.
Any idea will be highly appreciated.
Regards
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-06-13T10:08:58-07:00
The image that is there to download is jpg and thus has no transparency.
Nevertheless, if you just want to change any full transparency to some color, say white, then just flatten it against a white background
convert yourimage -background white -flatten result
If that is not what what you want please explain in more detail. Also identify your IM version and platform.
nasaa1
Posts: 3 Joined: 2013-06-11T02:03:16-07:00
Authentication code: 6789
Post
by nasaa1 » 2013-06-13T10:13:22-07:00
Apologies for the wrong image
I want to get rid of the transparency from certain part of image and not the whole image. So in this case I would like to get rid of transparency from the "RADIO TIMES" Text
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-06-13T11:35:45-07:00
Extract the alpha channel
convert flatten_canvas2.png -alpha extract 1tmp1.png
Then draw a white filled polygon over the area you want to make opaque in the alpha image.
see
http://www.imagemagick.org/Usage/draw/#primitives
Then replace the alpha channel in the original image with the new alpha channel image
convert flatten_canvas2.png newalphaimage.png -alpha off -compose copy_opacity -composite result.png