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

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
tba
Posts: 2
Joined: 2015-12-31T13:05:40-07:00
Authentication code: 1151

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

Post 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)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

alpha_opaque.png contains an embedded profile. If you strip it, I expect the images will look the same.
snibgo's IM pages: im.snibgo.com
tba
Posts: 2
Joined: 2015-12-31T13:05:40-07:00
Authentication code: 1151

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

Post by tba »

Thanks! I ran "convert -strip alpha_opaque.png ./alpha_opaque_stripped.png", and the images were identical as expected.
Post Reply