Hi
I want to embedd a srgb profile to a png image. Doing that on a jpg everything works fine (i got a "Profiles" section when running identify on output image)
When doing the same thing on a png image everything seems to work (no errors) but "Profiles" section is missing when using identify.
Im i doing something wrong here? Or is this expected?
PNG with embedded sRGB
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG with embedded sRGB
The docs say (somewhere; I forget where) that if IM is writing a PNG with sRGB profile, it just sets a PNG flag that says it is sRGB.
snibgo's IM pages: im.snibgo.com
Re: PNG with embedded sRGB
Im my case the input png does not have a srgb profile (but got colorspace=sRGB)
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG with embedded sRGB
I don't understand. The input has no profile, and you are not adding one, but expect the output to contain a profile?
Can you provide the exact command you are using, and the input file?
Can you provide the exact command you are using, and the input file?
snibgo's IM pages: im.snibgo.com
Re: PNG with embedded sRGB
That's correct. The PNG spec defines the "sRGB" chunk that carries only one byte: the "intent". We write that instead of the full sRGB profile. Any applicationsnibgo wrote:The docs say (somewhere; I forget where) that if IM is writing a PNG with sRGB profile, it just sets a PNG flag that says it is sRGB.
that understands ICC profiles is supposed to also recognize the PNG sRGB chunk and handle it as though a full sRGB profile were present.
Re: PNG with embedded sRGB
snibgo wrote:I don't understand. The input has no profile, and you are not adding one, but expect the output to contain a profile?
Can you provide the exact command you are using, and the input file?
Code: Select all
convert input.png -profile srgb.icc output.png
Re: PNG with embedded sRGB
Aha now i got itglennrp wrote:That's correct. The PNG spec defines the "sRGB" chunk that carries only one byte: the "intent". We write that instead of the full sRGB profile. Any applicationsnibgo wrote:The docs say (somewhere; I forget where) that if IM is writing a PNG with sRGB profile, it just sets a PNG flag that says it is sRGB.
that understands ICC profiles is supposed to also recognize the PNG sRGB chunk and handle it as though a full sRGB profile were present.
Thanks for the clarification!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: PNG with embedded sRGB
Just to add to the explanation:
If input.png has a profile, your command will convert the pixel values and add the profile. Otherwise, it will just add the profile. Then, because you are saving sRGB as PNG, it will save the sRGB chunk rather than inserting the actual profile in the file.
If input.png has a profile, your command will convert the pixel values and add the profile. Otherwise, it will just add the profile. Then, because you are saving sRGB as PNG, it will save the sRGB chunk rather than inserting the actual profile in the file.
snibgo's IM pages: im.snibgo.com