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
Virtual pixel transparent apparantly failing
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Virtual pixel transparent apparantly failing
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
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
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
The following *seemed* to work also:
convert input.png -alpha set -virtual-pixel Transparent -distort Arc 20 +repage output.png
Thanks
mmsood99
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Virtual pixel transparent apparantly failing
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
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
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Virtual pixel transparent apparantly failing
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.
but without -background it fails!
In other words you found a weird 'side-effect' in IM image creation function.
-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:
In other words you found a weird 'side-effect' in IM image creation function.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Virtual pixel transparent apparantly failing
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.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Virtual pixel transparent apparantly failing
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/