Skip to main content
Participating Frequently
November 17, 2018
Question

Assign sRGB profile to JPGs that have already been downsampled without changing image quality or size?

  • November 17, 2018
  • 2 replies
  • 3036 views

I have a batch of JPGs without an embedded RGB profile that I need to change to sRGB. The images have been extracted from a very large and complex PSD file that the web designer provided, and then "Exported as JPG" to appropriate file size and quality for quick loading of the web pages that are being built. Unfortunately I did not notice until too late that the "Embed Color Profile" check box was unchecked. I know I can just open the JPGs and Convert to Profile > sRGB, but then I have to save the JPG again, which results in a further loss of image quality and/or a change of the file size. I don't want to change the image in anyway except to embed the sRGB profile. I can't figure out any way to achieve this, and I don't think it's possible, but I thought I'd put it out there to see if anyone else has a better solution than diving back into the complex original PSD file and extracting the images again, this time with the "Embed Color Profile" check box checked. Thanks!

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
November 18, 2018

Another option is ExifTool...

Mac OS Terminal.app command line code to recursively embedd an sRGB ICC profile in all JPG files under a top level directory, overwriting original files without creating backups:

exiftool -overwrite_original -ext jpg '-ICC_Profile<=/Library/Application Support/Adobe/Color/Profiles/Recommended/sRGB Color Space Profile.icm' -r '/Users/username/Desktop/input file or folder'

There should only an approx. 3-5kb file size change in the before/after image for a matrix based sRGB profile (ExifTool does not change the binary image data, only metadata).

Prepression: Automator – DIY ExifTool GUI Services

__________________

MS Windows OS command line code to recursively embedd an sRGB ICC profile in all JPG files under a top level directory, overwriting original files without creating backups:

exiftool -overwrite_original -ext jpg "-ICC_Profile<=C:\Windows\System32\spool\drivers\color\sRGB Color Space Profile.icm" -r "C:\Users\username\Desktop\input file or folder"

dcaplanAuthor
Participating Frequently
November 18, 2018

Stephen, any chance you would be willing to write up step by step instructions for using exiftool to accomplish this sRGB embed (Mac OS 10.12.6) without changing the image quality and only adding 3KB to the file size? I'm not a programmer, so the instructions would need to be understandable by a graphic artist. Thanks.

Stephen Marsh
Community Expert
Community Expert
November 18, 2018
Stephen, any chance you would be willing to write up step by step instructions for using exiftool to accomplish this sRGB embed (Mac OS 10.12.6) without changing the image quality and only adding 3KB to the file size? I'm not a programmer, so the instructions would need to be understandable by a graphic artist. Thanks.

You should give yourself more credit... However I do understand, many GUI users are reluctant or avoid using a CLI when they should not be. I was the same once myself, however I was missing out as I wanted to do things that only CLI tools or scripting would allow and CLI is much easier than JavaScript for a non-coder to learn.

P.S. There are ways to run CLI without needing to enter the code more than once and there are also some GUI front ends for CLI tools, however they are often a crutch and only offer simple edits, then you still need to enter CLI code for other uses.

My post #6 did cover the exact command required (however it does presume some knowledge)*:

Re: Assign sRGB profile to JPGs that have already been downsampled without changing image quality or size?

You need to know/find the exact file path and spelling to various files and folders. You can usually get info/properties and copy the path or drag the file or sometimes folder into a text editor to capture the path or drag the file or folder into a command line tool to capture the path.

*Until I can write a blogpost covering ExifTool for new users/GUI users, please start with these links:

Installation

Running

First use

Dummies

Getting started with the CLI

Some visual and or animated examples that I have created in either the Bridge or Photoshop forums and their scripting sub-forums may also help:

Re: Bridge not showing time created, only date

Re: changing UPPER to lowercase keywords in Bridge or Lightroom

Re: Script or Action to Batch Determine Transparency?

Re: Action that can read and put metadata from CSV file?

Searching either the Bridge or Photoshop forums or their scripting sub-forums for the keyword “Exiftool” will bring up many hits with various examples.

I also have some posts on ExifTool here that may help with some examples:

Prepression: ExifTool

rob day
Community Expert
Community Expert
November 17, 2018

What OS are you using? OSX comes with an AppleScript droplet that uses a shell script to embed a chosen profile into the files dragged on to the droplet. The script name is Embed.app.

dcaplanAuthor
Participating Frequently
November 17, 2018

Ok, I created a droplet of the script by exporting it from Script Editor as an app. Now I can drag multiple files onto the droplet and embed them as sRGB. Great!! Except the file sizes are changing… getting much larger. An untagged JPG that was 149KB went to 347KB and the other went from 61KB to 92KB. Any idea why just embedding the sRGB profile with this script is causing the file size to grow so dramatically? Thanks for any info you might have. Much appreciated.

dcaplanAuthor
Participating Frequently
November 18, 2018

Have you tried opening one of the untagged jpgs in Photoshop and resaving it with a profile? I think it is expected behavior for embedded profiles to add weight.

Are these jpgs for web display or print? If they are for web only you might consider leaving them untagged because browsers (at least on the Mac side) display untagged RGB color as sRGB.

Here's tagged sRGB in Photoshop vs. the same file with no profile in Safari:


When I open a PSD and Export as JPG with a quality setting of 50 and no embedded profile, the file size is 46KB. When I do the exact same export, but embed the sRGB the file size is 49KB. So, at least when exporting as JPG from within Photoshop, the embedded color profile only adds 3KB. But when I run the untagged 46KB file through the droplet to embed the sRGB, it grows to 86KB. The sRGB profile itself is only 3KB, so I have no idea why the file size is increasing so much.

ExifTool looks a bit beyond my knowledge scope.

The client who is building the website just told me not to worry about the untagged images for now, so hopefully it won't be a problem. Good to know that Safari displays untagged images as sRGB.

Thanks for your input!