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
How to give background to the png at a particular area
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to give background to the png at a particular area
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.
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.
Re: How to give background to the png at a particular area
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
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
Re: How to give background to the png at a particular area
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
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