-evaluate-sequence mean creates transparent image

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
wheany
Posts: 2
Joined: 2012-04-12T03:28:02-07:00
Authentication code: 8675308

-evaluate-sequence mean creates transparent image

Post 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?
wheany
Posts: 2
Joined: 2012-04-12T03:28:02-07:00
Authentication code: 8675308

Re: -evaluate-sequence mean creates transparent image

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -evaluate-sequence mean creates transparent image

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: -evaluate-sequence mean creates transparent image

Post 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).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply