separate modifies channel values!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: separate modifies channel values!
"+channel" makes no difference for me:
D:\web\im>%IMG68610%convert rgb_no_alpha.png -channel a -separate +channel -format "%[fx:minima]" info:
0.999893
D:\web\im>%IMG68610%convert rgb_no_alpha.png -channel a -separate +channel -format "%[fx:minima]" info:
0.999893
snibgo's IM pages: im.snibgo.com
- shadowhand
- Posts: 14
- Joined: 2013-09-20T17:57:29-07:00
- Authentication code: 6789
Re: separate modifies channel values!
It's ImageMagick on Linux that displays the bug, not OSX, but your suggestion did not work:fmw42 wrote:On my Mac OSX IM 6.8.6.10 Q16 it works fine. But try adding +channel after the -separate and see if that makes a difference
Code: Select all
# convert rgb-no-alpha.png -channel a -separate +channel -format "%[fx:minima]" info:
0
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
try -channel o, perhaps there was a swapped missed and you are getting the inverse
convert rgb-no-alpha.png -channel o -separate +channel -format "%[fx:minima]" info:
convert rgb-no-alpha.png -channel o -separate +channel -format "%[fx:minima]" info:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
what do you get from
convert rgb-no-alpha.png -channel a -separate -format "%[min]" info:
or from
convert rgb-no-alpha.png -format "%[fx:minima.a]" info:
convert rgb-no-alpha.png -channel a -separate -format "%[min]" info:
or from
convert rgb-no-alpha.png -format "%[fx:minima.a]" info:
- shadowhand
- Posts: 14
- Joined: 2013-09-20T17:57:29-07:00
- Authentication code: 6789
Re: separate modifies channel values!
Code: Select all
# convert rgb-no-alpha.png -channel a -separate -format "%[min]" info:
3.4e+38
# convert rgb-no-alpha.png -format "%[fx:minima.a]" info:
1.33333e+36
# convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
1.33333e+36 -1.33333e+36
Code: Select all
# convert rgb-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
0 1
# convert rgb-alpha-partial.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
0 0.498039
- shadowhand
- Posts: 14
- Joined: 2013-09-20T17:57:29-07:00
- Authentication code: 6789
Re: separate modifies channel values!
It seems that using the "o" channel (whatever that is) seems to work better:
This is the correct result for this partially transparent image. But it doesn't work properly for an image with no alpha channel:
Code: Select all
# convert rgb-alpha-partial.png -channel o -separate +channel -format "%[fx:minima] %[fx:maxima]" info:
0.501961 1
Code: Select all
# convert rgb-no-alpha.png -channel o -separate +channel -format "%[fx:minima] %[fx:maxima]" info:
0 1
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
You must be on a Q32 compile if you get values in scientific notation e+38.
What is your exact IM version and compile Q level on both your systems?
What is your exact IM version and compile Q level on both your systems?
- shadowhand
- Posts: 14
- Joined: 2013-09-20T17:57:29-07:00
- Authentication code: 6789
Re: separate modifies channel values!
On Mac OS X 10.8.5:
On Debian Linux (Wheezy):
Code: Select all
% convert --version
Version: ImageMagick 6.8.6-3 2013-07-06 Q16 http://www.imagemagick.org
Code: Select all
# convert --version
Version: ImageMagick 6.8.6-9 2013-09-13 Q8 http://www.imagemagick.org
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
These values make no sense for either Q16 or Q8. Looks like your system may be corrupted or has some bad bugs in that version. Seems like no one else is getting that on current versions of IM.# convert rgb-no-alpha.png -channel a -separate -format "%[min]" info:
3.4e+38
# convert rgb-no-alpha.png -format "%[fx:minima.a]" info:
1.33333e+36
# convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
1.33333e+36 -1.33333e+36
Have you tried re-installing IM?
Have you checked to see that you do not have multiple versions of IM on your systems? Typically /usr/bin or /usr/local/bin? Perhaps you are using an old version of IM different from what you report or there are conflicts.
try
type -a convert
or
/usr/bin/convert -version
and
/usr/local/bin/convert -version
Last edited by fmw42 on 2013-09-23T12:27:20-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
convert -version
should be giving more information, such as whether OpenMP is enabled, whether HDRI is enable and all your delegates.
convert -version
Version: ImageMagick 6.8.6-10 2013-09-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps png tiff x xml zlib
should be giving more information, such as whether OpenMP is enabled, whether HDRI is enable and all your delegates.
convert -version
Version: ImageMagick 6.8.6-10 2013-09-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps png tiff x xml zlib
- shadowhand
- Posts: 14
- Joined: 2013-09-20T17:57:29-07:00
- Authentication code: 6789
Re: separate modifies channel values!
I get this same result on both Mac and Linux. There is very little chance my system is corrupted, as we do lots of complex ImageMagick operations and this is the only one with issues.fmw42 wrote:These values make no sense for either Q16 or Q8. Looks like your system may be corrupted or has some bad bugs in that version.# convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
1.33333e+36 -1.33333e+36
I can, but this seems like a red herring. We have the same version/package of ImageMagick installed on tens, if not hundreds, of VMs.Have you tried re-installing IM?
Have you checked to see that you do not have multiple versions of IM on your systems?
Code: Select all
mac % type -a convert
convert is /usr/local/bin/convert
linux # type -a convert
convert is /usr/bin/convert
Code: Select all
mac % convert -version
Version: ImageMagick 6.8.6-3 2013-07-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg png xml zlib
linux # convert -version
Version: ImageMagick 6.8.6-9 2013-09-13 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jbig jng jp2 jpeg lcms ltdl lzma png png tiff xml zlib
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: separate modifies channel values!
Shadowhand's results for rgb-no-alpha.png, eg 1.33333e+36, remind me of results from my C-language programs when I have forgotten to initialize a variable.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
On IM 6.8.6.9 and 6.8.6.10 Q16 Mac OSX I get
convert rgb-no-alpha.png -channel a -separate -format "%[fx:minima]" info:
1
convert rgb-no-alpha.png -channel a -separate -format "%[fx:maxima]" info:
1
convert rgb-no-alpha.png -channel a -separate -format "%[fx:minima] %[fx:maxima]" info:
1 1
But using channel indices does give bad results
convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
5.18807e+33 -5.18807e+33
So I would have to say there is a bug in this respect.
convert rgb-no-alpha.png -channel a -separate -format "%[fx:minima]" info:
1
convert rgb-no-alpha.png -channel a -separate -format "%[fx:maxima]" info:
1
convert rgb-no-alpha.png -channel a -separate -format "%[fx:minima] %[fx:maxima]" info:
1 1
But using channel indices does give bad results
convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]" info:
5.18807e+33 -5.18807e+33
So I would have to say there is a bug in this respect.
- shadowhand
- Posts: 14
- Joined: 2013-09-20T17:57:29-07:00
- Authentication code: 6789
Re: separate modifies channel values!
Looks like it has been fixed by something else in some later version:
Even the false-alpha file (opaque PNG with alpha channel forced on) registers correctly here. I'm not sure exactly what version fixed it, but 6.8.6-10 is certainly fixed.
Code: Select all
mac % % convert -version 1 ↵
Version: ImageMagick 6.8.6-10 2013-09-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib freetype jng jpeg ltdl png png xml zlib
mac % for file in alpha false-alpha no-alpha alpha-partial; do; echo $file; convert "rgb-$file.png" -channel a -separate -format "%[fx:minima] %[fx:maxima]\n" info:; done
alpha
0 1
false-alpha
1 1
no-alpha
1 1
alpha-partial
0.501961 1
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: separate modifies channel values!
I still get
convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]\n" info:
5.18807e+33 -5.18807e+33
convert -version
Version: ImageMagick 6.8.6-10 2013-09-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps png tiff x xml zlib
Mac OSX Snow Leopard
It works fine as I had above with -channel a -separate same as you (see above). But it does not work with %[fx:minima.a] selecting the channel that way.
It seems to work for r,g,b but not a
convert rgb-no-alpha.png -format "%[fx:maxima.r] %[fx:maxima.g] %[fx:maxima.b] %[fx:maxima.a]\n" info:
1 1 1 -5.18807e+33
convert rgb-no-alpha.png -format "%[fx:minima.a] %[fx:maxima.a]\n" info:
5.18807e+33 -5.18807e+33
convert -version
Version: ImageMagick 6.8.6-10 2013-09-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps png tiff x xml zlib
Mac OSX Snow Leopard
It works fine as I had above with -channel a -separate same as you (see above). But it does not work with %[fx:minima.a] selecting the channel that way.
It seems to work for r,g,b but not a
convert rgb-no-alpha.png -format "%[fx:maxima.r] %[fx:maxima.g] %[fx:maxima.b] %[fx:maxima.a]\n" info:
1 1 1 -5.18807e+33