[Solved] How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o

The right place to speak and share about your experiences of GraphicConverter
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

[Solved] How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o

Post by porg »

I already established this How to convert a PNG with an Adobe RGB 1998 profile to a WEBP with pixels in sRGB values but no embedded profile

I also established my image assets are quite heterogenous in terms of color profile: 54% sRGB, 26% none (which hopefully all are sRGB indeed), 20% various other profiles. Could do this with the help of HoudahSpot's excellently capable and flexible column view.
👉 See screenshots below.

Now in a GraphicConverter batch conversion: I want to normalize each image into sRGB with perceptual color conversion, and then save each into a WebP with no color profile, and web browsers will hence assume them to be sRGB.

The uncertainty I face: In GraphicConverter's Batch Editor the action "Change Color Profile" has a single choice "sRGB.icc" which is preselected + a "Choose…" option which let's you choose an arbitrary ICC file. Now before doing the batch conversion and use the normalized images on my website I wanted to be sure that this is really sRGB without a doubt.

My system provides these color profile locations and possibly relevant ICC color profiles:

Code: Select all

/System/Library/ColorSync/Profiles/
  sRGB Profile.icc
/Library/ColorSync/Profiles/
  <None with sRGB in its name>
/Library/Application Support/Adobe/Color/Profiles
  <None with sRGB in its name>
/Library/Application Support/Adobe/Color/Profiles/Recommended
  sRGB Color Space Profile.icm
~/Library/Application Support/GraphicConverter/Profiles
  sRGB built-in.icc
  sRGB IEC61966-2.1.icc
  sRGB.icc
Confirmed by comparing with binary diff: sRGB Profile.icc == sRGB IEC61966-2.1.icc == sRGB Color Space Profile.icm
👉 see screenshot below

Questions:
• Why does GraphicConverter provide its own sRGB.icc which differs from /System/Library/ColorSync/Profiles/sRGB Profile.icc ?
• Why does GraphicConverter have an exact copy of "sRGB.icc" as "sRGB built-in.icc" in its profile folder?
• Which profile should I use to achieve my goal outlined above?


Screenshots:
Color Profiles - Heterogenous across Image Assets.png
Color Profiles - Heterogenous across Image Assets.png (712.91 KiB) Viewed 1508 times
Color Profiles - Different sRGB profiles.png
Color Profiles - Different sRGB profiles.png (524.58 KiB) Viewed 1508 times
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by forum_adm »

GraphicConverter provides its own sRGB profile from littleCMS. So, a sRGB profile is available in any case (even with limited file access).

You can use the system sRGB or the GraphicConverter provide sRGB. Both should work the same way.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by porg »

@forum_adm

I had my eyes on ~/Library/Application Support/GraphicConverter/Profiles/ and had some observations and thoughts over time.

1) sRGB IEC61966-2.1.icc
- Always gets its creation and modification changed to now when you run an GraphicConverter update.
- As this is a 1:1 binary duplicate of /System/Library/ColorSync/Profiles/sRGB Profile.icc I assume that on each GC update, some routine copies the system's sRGB profile file to GC's own profiles folder. Correct?

2) The identical file under two names: "sRGB built-in.icc" and "sRGB.icc".
-The existence of an identical profile file under two different names makes me guess this was an attempt by you to differentiate (in info dialogs etc). But where? Could you look that up in code?
- Maybe you wanted to differentiate exactly between "embedded" vs "referenced"? As suggested in my recent proposal:
ColorSync: Differentiate "Embed color profile" vs. "Set color profile reference"
- If so please check that those two endeavors have the proper synergy/consistency and don't contradict each other.

I'd appreciate some infos on the whereabouts of the profile files and their naming. Thanks.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by forum_adm »

1) build5661 will no longer update the profile if one already exists

2) sRGB built in is a sRGB profile created by littleCMS. The profile filename is always created from the description field of a profile.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by porg »

Ad 1) Was just a question, no call to action. Now you have acted and changed GC's update routine. I'm not sure that the chosen way is the right strategy. What if the system profile changed indeed? If the then outdated profile exists in GC's folder it would not be copied. The correct behavior rather would be to only copy to GC-profile-folder if the profile at the sys-profile-folder is newer.

Ad 2) Thanks for explaining from where the filename "sRGB built-in" comes. That still did not answer why there is a duplicate with the name of just "sRGB" then. Please explain.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by forum_adm »

1) The sRGB profile which Apple supplies will not change. The profile is dated from 1998 (if you open it with a double click).
So, no update is required.

2) Images may contain sRGB profiles with different description names - that cause the additional files.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by porg »

Ad 1) Finally something in IT that is in stone and needs no dynamic adaptation 😂

Ad 2) You misread: GC has a duplicate profile under two different names "sRGB.icc" and "sRGB-builtin.icc" in its app support color profile folder. Just see the files highlighted in the turquoise colored square on my screenshot in my initial post. So you as GC's developer did that either on purpose or by mistake. My inquiry is to find out whether that has a purpose or none. And if none, if it's just a leftover, then get rid of it, to avoid confusion.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by forum_adm »

Ok, I did not reply very clear. The current build will no longer store the sRGB build in. Just trash it.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: How to batch convert PNGs with heterogenous color profiles to sRGB values perceptually and save as WebP w/o profile?

Post by porg »

Cleanup completed.

Code: Select all

$ cd ~/Library/Application\ Support/GraphicConverter/Profiles/
$ ls -l sRGB*
-rw-r--r--  1 me  staff  3144 Nov 17 16:47 sRGB IEC61966-2.1.icc
-rw-r--r--  1 me  staff  6876 Nov 10 18:51 sRGB built-in.icc
-rw-r--r--  1 me  staff   536 Nov 17 14:05 sRGB.icc

$ rm sRGB\ built-in.icc 
$ ls -l sRGB*
# The profile copy from Apple. Will not be updated on each GC update anymore, but kept as-is:
-rw-r--r--  1 me  staff  3144 Nov 17 16:47 sRGB IEC61966-2.1.icc	
# This comes from www.littleCMS.com . Probably also will not update too often:
-rw-r--r--  1 me  staff   536 Nov 17 14:05 sRGB.icc
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

I observed one more change on which I would appreciate some official words from the developer:

Post by porg »

GraphicConverter b5661 sRGB ICC now only 536 bytes.png
GraphicConverter b5661 sRGB ICC now only 536 bytes.png (150.77 KiB) Viewed 1452 times

sRGB different profile variants.png
sRGB different profile variants.png (199.96 KiB) Viewed 1446 times

sRGB profiles - eg white point tristimulus has different X Y Z parameters.png
sRGB profiles - eg white point tristimulus has different X Y Z parameters.png (280.63 KiB) Viewed 1449 times


• I appreciate the reduction in filesize from 7KB to only 536 bytes!
• Does this smaller profile result in the (nearly) same ColorSync outcome?
• Both regarding display and perceptual color conversion in the batch process?
• I have my doubts that less parameters can guarantee the same exact outcome, but I ain't an engineer and no color management engineer either.
• Would love an explanation that can calm me down, now that I'm in the middle of an image normalization process (which I finished yesterday, luckily I used Apple's (= Helett Packard's) sRGB ICC profile, the largest one, so hopefully the most precise one.
Post Reply