background transparency problem

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
pksingh_alld
Posts: 2
Joined: 2015-06-02T02:27:27-07:00
Authentication code: 6789

background transparency problem

Post by pksingh_alld »

I'm using following command with transparent png image "heart.png" has black background when applied opacity in -draw command.

convert -size 500x500 xc:white -draw "translate 225,250 opacity 0.5 image over -200,-150 450,300 'heart.png'" output.jpg


Can anyone help me in this please?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: background transparency problem

Post by snibgo »

JPG doesn't support transparency.
snibgo's IM pages: im.snibgo.com
pksingh_alld
Posts: 2
Joined: 2015-06-02T02:27:27-07:00
Authentication code: 6789

Re: background transparency problem

Post by pksingh_alld »

its not a matter what is output format... i wants to apply opacity on heart.png and outcome of that write on output file(jpg or png). my problem is I don't wants opacity on transparent area. by default its assumes black background and applied opacity on whole area in place of graphics only. I can get it using following command

convert heart.png -matte -channel A -evaluate set 50% -channel rgba output.png

or

convert heart.png -matte -channel A +level 0,50% +channel output.png

but i wants it using -draw command.
Post Reply