Page 1 of 1

-evaluate-sequence mean creates transparent image

Posted: 2012-04-12T03:42:38-07:00
by wheany
I have this base image: Image

Using this command:

Code: Select all

convert base.png ( -size 100x100 xc: +noise Random ) -evaluate-sequence mean base-noise.png
Creates this image:Image(It's transparent)
After I remove the alpha channel, I see that the image was exactly what I wanted:Image

If I instead use this command:

Code: Select all

convert base.png ( -size 100x100 xc: +noise Random ) -append base-noise-appended.png
I get this image: Image (again, exaclty what I expected)

Is this a bug or have I misunderstood something in how evaluate-sequence works?

Re: -evaluate-sequence mean creates transparent image

Posted: 2012-04-12T03:49:15-07:00
by wheany
Version info:

Code: Select all

>convert -version
Version: ImageMagick 6.7.6-5 2012-04-04 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

Re: -evaluate-sequence mean creates transparent image

Posted: 2012-04-12T10:56:52-07:00
by fmw42
I can confirm your result on IM 6.7.6.5 Q16 Mac OSX Snow Leopard.

Your base image has an alpha channel that is totally opaque, and thus not relevant, but is confusing the -evualuate-sequence.

Workaround is:

convert 1base.png \( -size 100x100 xc: +noise Random \) -alpha off -evaluate-sequence mean 1base-noise2.png

It won't hurt for any image that has no alpha channel or has a fully opaque alpha channel.

Nevertheless, it is a bug in my opinion.

Re: -evaluate-sequence mean creates transparent image

Posted: 2012-04-15T04:09:44-07:00
by anthony
Note: insteed of using -size 100x100 xc: you could have used +clone instead :-)

To make it easier for testing here I use a bulti-in image to show the problem...

Code: Select all

convert rose: -alpha set \( +clone +noise Random \) \
                -evaluate-sequence mean   show:
More than likely it is a bug in handling of an images ALPHA, like Noise is assuming only RGB channels.
That I thought may have been a bug in -channel handling, something I experienced when I created -sparse-colors operator.

To me it seems like -evaluate-sequence needs to be expaned beyond just an assumed RGB channels but to all active channels. I have other notes in that Subtract, Multiply and Divide is also rather usless in its current implementation.
See IM Examples, Layering Images, evaluate-seqence
http://www.imagemagick.org/Usage/layers ... e-sequence

ASIDE: to Cristy. in IMv7 you also get a transparent image but not perfectly transparent, I see some minor garbage as well, indicating uncleared alpha channel memory!

Code: Select all

magick rose: -alpha set \( +clone +noise Random \) \
         -evaluate-sequence mean -background black -alpha remove show:
Which indicates memory clearing failure as well.

I have made a note of these problems. But I am not planning making option changes until I finished IMv7 scripting development (alpha).