Page 1 of 1
Virtual pixel transparent apparantly failing
Posted: 2012-01-14T06:15:12-07:00
by mmsood99
Hi
I am using a simple command to attempt to distort an image and make the virtual pixels transparent:
convert input.png -virtual-pixel Transparent -distort Arc 20 +repage output.png
But the resulting image has black pixels where I expect the virtual pixels to be. They render black in gimp, paint etc
I posted the input and output images at the links below:
Input
http://www.flickr.com/photos/51035382@N00/6694667523/
Output:
http://www.flickr.com/photos/51035382@N00/6694667555/
Please, what am i doing wrong?
Thanks
mmsood99
Re: Virtual pixel transparent apparantly failing
Posted: 2012-01-14T11:10:21-07:00
by fmw42
Looks like you may have found a bug and I will forward it to the Bugs forum.
convert rose: -virtual-pixel transparent -distort arc 20 +repage rose_arc.png
The above gives a black background and is ignoring setting the alpha channel
But either of these work fine.
convert rose: -virtual-pixel background -background none -distort arc 20 rose_arc2.png
or
convert rose: -channel rgba -alpha on -virtual-pixel transparent -distort arc 20 +repage rose_arc3.png
Re: Virtual pixel transparent apparantly failing
Posted: 2012-01-14T12:57:30-07:00
by mmsood99
Many thanks for your prompt attention to this and your examples.
The following *seemed* to work also:
convert input.png -alpha set -virtual-pixel Transparent -distort Arc 20 +repage output.png
Thanks
mmsood99
Re: Virtual pixel transparent apparantly failing
Posted: 2012-01-16T13:38:11-07:00
by fmw42
Magick or Anthony,
Is this a bug or am I misunderstanding something here.
Why does this not work (without setting -alpha set)
convert rose: -virtual-pixel transparent -distort arc 20 +repage rose_arc.png
The above gives a black background and is ignoring setting the alpha channel
But this works fine (without setting -alpha set)
convert rose: -virtual-pixel background -background none -distort arc 20 rose_arc2.png
Re: Virtual pixel transparent apparantly failing
Posted: 2012-01-21T05:34:10-07:00
by anthony
It is not a bug. the input image just did not have a alpha channel to put transparent pixel into the image!
-alpha set was the correct solution.
I think setting background to none caused new 'blank' images to be set with an alpha channel even though the source image did not have an alpha channel. Seems to be a weird effect!
I say this because this also creates transparent in the reuslt.
Code: Select all
convert rose: -virtual-pixel transparent -background none +distort SRT 45 show:
but without
-background it fails!
In other words you found a weird 'side-effect' in IM image creation function.
Re: Virtual pixel transparent apparantly failing
Posted: 2012-01-21T10:01:46-07:00
by fmw42
Seems to me that it would make sense to have -virtual-pixel transparent also set the alpha channel. It seems obvious when using it that that is what you want it to do.
Re: Virtual pixel transparent apparantly failing
Posted: 2012-01-21T22:18:16-07:00
by anthony
It does indeed. Perhaps a word to Magick is in order!
Specifically that a alpha channel is enabled for new image clones (in the special internal case that an image is cloned but without copying the image data as image is being resized or data modified from source image) and background or virtual-pixel indicates user my need it.