Page 1 of 1

Possible bug? Virtual-pixel + distort = ... gray corner ?

Posted: 2008-04-17T20:10:29-07:00
by redna379
Hello.

ImageMagick Version i'm using: 6.3.7 12/07/07 Q16

I have this source image:
Image

I apply this command:

Code: Select all

convert before.png -channel RGBA -virtual-pixel transparent -distort Perspective '0,0,0,0 400,0,400,9 0,232,116,130 400,232,376,232' distorted.png
I obtain this image:
Image

I'm going crazy. Why do i obtain that gray triangle on bottom-left corner?
It seems virtual-pixel method is not used "till there".
I tryed with background options, flatten, matte.. everything.
Any idea on what is causing that color to be placed there?

Thank you in advance,

Alex

Re: Possible bug? Virtual-pixel + distort = ... gray corner ?

Posted: 2008-04-17T22:02:46-07:00
by fmw42
You should add -matte before -channel RGBA (to be sure the alpha is create if it is not already, although in your case your image is already mostly transparent) and more importantly there is a parameter -mattecolor for areas outside the perspective. So the following works for me in IM 6.4.0-7

convert before.png -matte -channel RGBA -virtual-pixel transparent -mattecolor none \
-distort Perspective '0,0,0,0 400,0,400,9 0,232,116,130 400,232,376,232' distorted.png

See the examples at
http://www.imagemagick.org/Usage/distorts/#horizon
where -mattecolor is used to make the "skycolor"

P.S. You might want to checkout my script 3Drotate and/or rotate3D at
http://www.fmwconcepts.com/imagemagick/index.html

Re: Possible bug? Virtual-pixel + distort = ... gray corner ?

Posted: 2008-04-18T05:20:03-07:00
by redna379
Yeah, mattecolor was the key!

Magick is really powerful, but there are so many options and sometimes it's really hard to find if what's needed is there or not.
Just now, evenif i read and read, i found the notes about mattecolor in Anthony's distort page.

Thank you very much Fmw42!