Strange -virtual-pixel transparent and -shadow 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Strange -virtual-pixel transparent and -shadow problem

Post by Bonzo »

I have just been looking at some of my code and I noticed the effect below. You can see at the bottom the corner of the image which is transparent is having an effect on the shadow.
This is the relevant part of the code I am using:

Code: Select all

exec ( "convert in.jpg ( -thumbnail 1000x1000 -crop 600x800+0+0 +repage ) -crop 100x466+0+100 -fill black -colorize 40% -rotate 90 -pointsize 35 -fill Black -gravity north -annotate +0+20 \"www.rubblewebs.co.uk\" -rotate -90 -virtual-pixel transparent -distort Perspective \" 0,0 0,27 100,0 100,0 100,466 100,466 0,466 0,412 \" testSide.png");
exec ( "convert testSide.png ( +clone -background gray -shadow 80x3-15+15 ) +swap -background none -layers merge +repage test.png");
echo "<img src=\"test.png\">";
When checking the testSide.png image in Photoshop the background is transparent - do I need to add some sort of alpha setting before creating the shadow?

Image
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Strange -virtual-pixel transparent and -shadow problem

Post by Bonzo »

Miff output for the side has the same final result and I forgot to say my version is ImageMagick 6.9.0-5 Q16 x64 2015-01-31
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Strange -virtual-pixel transparent and -shadow problem

Post by Bonzo »

It is a bug as it works OK on ImageMagick 6.8.9-6 Q16 x86_64 2014-08-03
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Strange -virtual-pixel transparent and -shadow problem

Post by snibgo »

You may need to "+repage" testside.png, as the second "-crop" leaves offsets.

If that doesn't help, post a copy of testside.png. I'm still on v6.9.0-0, and it might be a later bug.
snibgo's IM pages: im.snibgo.com
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Strange -virtual-pixel transparent and -shadow problem

Post by Bonzo »

Thanks for the input snibgo; I think I tried an extra +repage without any effect. I have reported it as a bug as it worked on an older version OK.
Post Reply