Page 1 of 1

-virtual-pixel set always to "edge" with distort command

Posted: 2011-11-07T21:05:37-07:00
by sockster
Here is my command:

Code: Select all

convert 2.png -alpha set -virtual-pixel checker-tile -distort Perspective '0,0,0,0 0,418,0,300 436,418,350,250 436,0,350,50' output.png
image I used:
Image

what I get:
Image

As you can see my virtual pixels are set to edge.
I've tried other options, like random and transparent with no change.
What am I missing here? Command options order? Do I need something else?

Re: -virtual-pixel set always to "edge" with distort command

Posted: 2011-11-07T22:32:36-07:00
by fmw42
Your command works just fine for me under IM 6.7.3.4 Q16 Mac OSX Tiger.

It might help to know what version of IM you are using and what platform? I suspect it is a version issue. Perhaps some of the virtual-pixel settings were not available in your release for -distort perspective.

What do you see listed from

convert -list virtual-pixel

It it lists checkertile, then perhaps -distort perspective was not sensitive to that option for your release.

Re: -virtual-pixel set always to "edge" with distort command

Posted: 2011-11-07T23:22:29-07:00
by sockster
I am using Ubuntu Oneiric Ocelot, ImageMagick was installed with apt-get install

Code: Select all

convert --version
Version: ImageMagick 6.6.0-4 2011-06-15 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP 

convert -list virtual-pixel
Background
Black
CheckerTile
Dither
Edge
Gray
HorizontalTile
HorizontalTileEdge
Mirror
Random
Tile
Transparent
VerticalTile
VerticalTileEdge
White
output of apt-cache show imagemagick (pastebin.com)

Re: -virtual-pixel set always to "edge" with distort command

Posted: 2011-11-08T10:29:08-07:00
by fmw42
I am not the expert on -distort, but as it works fine for me with the current release, I have to assume that it is an IM version issue and suggest you upgrade if you can.

Re: -virtual-pixel set always to "edge" with distort command

Posted: 2011-11-08T18:11:06-07:00
by anthony
Are you sure you want Checker-Tile and not Tile? I used Tile as part of my testing when creating the distort functions.

CheckerTile (and other Tile types) was a more recent addition... I added then in IM v6.4.2-6, including some special degenerate color handling for extremes when using distort to "viewing distant horizons".

Never had any problems with it.

A test with "logo:" image works find for me...

Code: Select all

convert logo: -alpha set -virtual-pixel checker-tile \
            -distort Perspective '0,0,0,0 0,418,0,300 436,418,350,250 436,0,350,50' \
            show:
Hmmm you probably should define a background color. If undefined it will default to the background meta-data of the incoming image, which could be jusrt (it only defaults to white only for 'created' images like labels)

Try the simpler examples in
http://www.imagemagick.org/Usage/misc/#checker_tile

These examples reduce the complexity of the operation so we can better see what is happening. It is working fine on my own machine.

Mirror on the other hand did have a bug, in that it only mirrored immediate neighbours, and not the images further way. I personally fixed that bug at the around time I added the newer tile operations. IM v6.5.0-1 See note in
http://www.imagemagick.org/Usage/misc/#mirror

Re: -virtual-pixel set always to "edge" with distort command

Posted: 2011-11-08T19:47:06-07:00
by sockster
anthony wrote:Are you sure you want Checker-Tile and not Tile?
It doesn't matter what I set virtual-pixel to, the output image will always reset it to edge, I tested -background none and coral - neither changes anything.

fmw42 wrote:I am not the expert on -distort, but as it works fine for me with the current release, I have to assume that it is an IM version issue and suggest you upgrade if you can.
Perhaps you know if there Is an official software repository for Ubuntu Oneiric Ocelot?

Re: -virtual-pixel set always to "edge" with distort command

Posted: 2011-11-08T21:01:12-07:00
by fmw42
Perhaps you know if there Is an official software repository for Ubuntu Oneiric Ocelot?
Sorry, no. I am on a Mac and just compile from source.

Can you use one of the unix binaries at http://www.imagemagick.org/script/binary-releases.php otherwise, from source at http://www.imagemagick.org/download/www ... .html#unix


You could try searching with Google:

https://launchpad.net/ubuntu/oneiric/+p ... magemagick
https://launchpad.net/ubuntu/+source/imagemagick
https://help.ubuntu.com/community/ImageMagick
http://ubuntuguide.net/install-imagemag ... untu-linux