Page 1 of 1

Alpha channel: srgb(X,Y,Z) looks different than srgba(X,Y,Z,1)?

Posted: 2015-12-31T13:19:04-07:00
by tba
I have two images. The first appears darker than the second (both in Preview and Chrome).

But one is full of srgb(38,156,120) pixels, and the other is full of srgba(38,156,120,1) pixels.
Why do they look different?

Code: Select all

➜  convert alpha_off.png txt:- | head
# ImageMagick pixel enumeration: 60,52,255,srgb
0,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
1,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
2,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
3,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
4,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
5,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
6,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
7,0: (9766,40092,30840)  #269C78  srgb(38,156,120)
8,0: (9766,40092,30840)  #269C78  srgb(38,156,120)

➜  convert alpha_off.png txt:- | sed 's/^[0-9][^:]*://g' | sort -r | uniq
# ImageMagick pixel enumeration: 60,52,255,srgb
 (9766,40092,30840)  #269C78  srgb(38,156,120)

Code: Select all

➜  convert alpha_opaque.png txt:- | head
# ImageMagick pixel enumeration: 60,52,255,srgba
0,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
1,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
2,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
3,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
4,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
5,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
6,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
7,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)
8,0: (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)

➜  temp  convert alpha_opaque.png txt:- | sed 's/^[0-9][^:]*://g' | sort -r | uniq
# ImageMagick pixel enumeration: 60,52,255,srgba
 (9766,40092,30840,65535)  #269C78FF  srgba(38,156,120,1)

Re: Alpha channel: srgb(X,Y,Z) looks different than srgba(X,Y,Z,1)?

Posted: 2015-12-31T13:39:45-07:00
by snibgo
alpha_opaque.png contains an embedded profile. If you strip it, I expect the images will look the same.

Re: Alpha channel: srgb(X,Y,Z) looks different than srgba(X,Y,Z,1)?

Posted: 2015-12-31T13:47:21-07:00
by tba
Thanks! I ran "convert -strip alpha_opaque.png ./alpha_opaque_stripped.png", and the images were identical as expected.