Page 1 of 1

Feature request: "-composite-sequence"

Posted: 2014-02-17T15:13:36-07:00
by snibgo
I wanted to do a "-compose Add" to a number of images, to add them all together. When pixels have partial transparency, "-evaluate-sequence Sum" gives the wrong result.

So, as a feature request (perhaps for v7), I ask for "-composite-sequence" which is such that:

convert in1.png i2.png in3.png ... -compose XXX -composite-sequence out.png

gives exactly the same result as:

convert -compose XXX in1.png -composite i2.png -composite in3.png ... -composite out.png

Unlike "-composite", "-composite-sequence" wouldn't use a third image as a mask.

Re: Feature request: "-composite-sequence"

Posted: 2014-02-17T15:32:42-07:00
by fmw42
see if -poly has the same issue with transparency.

-flatten should work, though not sure about the add issue. see http://www.imagemagick.org/Usage/layers ... thumbnails

How about -compose add -layers merge? Does that work?

Re: Feature request: "-composite-sequence"

Posted: 2014-02-17T16:04:39-07:00
by fmw42
What is it that you are trying to do with the alpha channels --- add the pixels only where opaque or only where transparent? And what happens when the there is 8-bit alpha rather than binary alpha? Can you clarify a bit further about the processing functionality you desire?

Re: Feature request: "-composite-sequence"

Posted: 2014-02-17T16:09:35-07:00
by snibgo
"-poly" gives the same result (practically) as "-evaluate-sequence Sum".

"-compose Add -composite" and "-compose Add -layers merge" give two other results.


F:\web\im>%IM%convert xc:rgba(10%,20%,30%,0.9) xc:rgba(40%,50%,60%,0.1) -poly "1,1 1,1" txt:
# ImageMagick pixel enumeration: 1,1,65535,srgba
0,0: (50.0008%,69.9992%,90.0008%,1) #8000B332E666 srgba(50.0008%,69.9992%,90.0008%,1)

F:\web\im>%IM%convert xc:rgba(10%,20%,30%,0.9) xc:rgba(40%,50%,60%,0.1) -evaluate-sequence Sum txt:
# ImageMagick pixel enumeration: 1,1,65535,srgba
0,0: (50.0008%,69.9992%,90.0008%,0.999985) #8000B332E666FFFE srgba(50.0008%,69.9992%,90.0008%,0.999985)


F:\web\im>%IM%convert xc:rgba(10%,20%,30%,0.9) xc:rgba(40%,50%,60%,0.1) -compose Add -composite txt:
# ImageMagick pixel enumeration: 1,1,65535,srgba
0,0: (13.0007%,22.9999%,33.0007%,0.909987) #21483AE1547BE8F4 srgba(13.0007%,22.9999%,33.0007%,0.909987)

F:\web\im>%IM%convert xc:rgba(10%,20%,30%,0.9) xc:rgba(40%,50%,60%,0.1) -compose Add -layers merge txt:
# ImageMagick pixel enumeration: 1,1,65535,srgba
0,0: (23.0014%,32.9992%,43.0014%,1) #3AE2547A6E15 srgba(23.0014%,32.9992%,43.0014%,1)