Separating alpha channel yields values that are too low.

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bram
Posts: 1
Joined: 2014-02-18T17:34:59-07:00
Authentication code: 6789

Separating alpha channel yields values that are too low.

Post by bram »

Hello,

So I have a PNG with alpha in it.
Created with inkscape, I created a white 64x64 image with alpha value 90.

When I extract the alpha channel with NetPBM, I get a proper result: value 90.

When I extract the alpha channel with ImageMagick, I get the value 26 instead, far too low.

Code: Select all

$ pngtopnm -alpha white.png > white.pgm
$ pgmhist white.pgm 
value	count	b%	w%
-----	-----	--	--
90	4096	  100%	  100%
$ convert white.png -channel A -separate out.pgm
$ pgmhist out.pgm 
value	count	b%	w%
-----	-----	--	--
26	4096	  100%	  100%
Why doesn't ImageMagick output the proper values?
Version: ImageMagick 6.7.7-10 2013-09-10 Q16

Thanks,

Bram
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Separating alpha channel yields values that are too low.

Post by snibgo »

The numbers correspond to a RGB/sRGB problem. Your IM is old, at a time when it made strange assumptions that greyscale files were RGB. Try a more modern version.
snibgo's IM pages: im.snibgo.com
Post Reply