[Closed] (IM7) Find same pixel in n images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: (IM7) Find same pixel in n images
See -set at http://www.imagemagick.org/Usage/masking/#alpha_set. I generally prefer -alpha on, if I know the image has transparency. But it is no always need, unless you have used -alpha off. -alpha set may turn your image opaque if you have already used -alpha off. So unless you have alpha off, just don't include -set, unless you want to give an opaque image a transparent alpha or a transarent image an opaque alpha.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: (IM7) Find same pixel in n images
But I think we digress. What was our original issue and has it been solved?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: (IM7) Find same pixel in n images
Well... on IM v7.0.2-5 on Windows 8.1, this is what happens:
w.png is opaque white, of course. Let's separate the alpha channel:
x.png is black. Huh? The problem (I think) is that under v7, w.png doesn't have an alpha channel. So IM returns zero for that channel that doesn't exist. (I think this is stupid behaviour. If there is no alpha, the image is opaque, so the alpha should be taken as 100%.)
The workaround is to use "-alpha set".
Now we get a sensible result. x2.png is white.
Code: Select all
%IMG7%magick -size 10x10 xc:White w.png
Code: Select all
%IMG7%magick w.png -channel A -separate +channel x.png
The workaround is to use "-alpha set".
Code: Select all
%IMG7%magick w.png -alpha set -channel A -separate +channel x2.png
snibgo's IM pages: im.snibgo.com
Re: [Closed] (IM7) Find same pixel in n images
Thanks for the help, I processed a few images, but have moved on to a custom solution programmed in Python with a stats package.