[magick-users] Where is the background coming from
Anthony Thyssen
anthony at griffith.edu.au
Mon Jul 23 19:44:50 PDT 2007
- Tong - on wrote...
| Hi,=20
|
| The background of pic1.png has been cleared (using gimp). After the
| following command (to produce the sketch effect), the cleared background
| shows up again in pic1.gif. I'm wondering why the cleared background can
| still managed to show up, and how can I fix the problem.=20
|
| convert pic1.png \( +clone -median 2 -blur 0x7 -negate \) \
| -matte -channel A -evaluate set 50% -compose plus -composite pic1.gif
|
Of course the background shows up again. You replaced all transparnency
values with 50% in BOTH images, added together that is 100% opaque!
Try using
-evaluate multiply .5
or -evaluate divide 2
Instead. Do not use a percentage, as that is a percentage of color
and not 1/2.
Also note that GIF does not allow semi-transparency, so your source
image better not be using any semi-transparency.
| Here are the picture and the result.=20
|
| http://xpt.sourceforge.net/download/pic1.png
| http://xpt.sourceforge.net/download/pic1.gif
|
| I've also tried to specify -channel RGBA, but the result is all grayed.
|
| convert pic1.png \( +clone -median 2 -blur 0x7 -negate \) \
| -matte -channel RGBA -evaluate set 50% -compose plus -composite pic1.=
| gif
|
Naturally you just SET every color to 50% grey and 50% transparent!
See IM Examples
Evaluate, Faster Simple Math Operations
http://www.imagemagick.org/Usage/transform/#evaluate
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
Never play leap frog with a Unicorn -- Grand Wizard Murphy
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list