sips --embedProfile is reducing jpeg file size by half

I'm trying to use sips to embed the sRGB color profile to some jpegs, and when I do so, the resulting file size is always about 1/2 the original size. If I open the jpegs in Preview and embed the color profile there and save, there is a negligible file size difference. Any ideas as to what is going on when sips embeds the profile?

MacBook Pro (Early '08), Mac OS X (10.6.2)

Posted on Jan 18, 2010 7:09 PM

Reply
6 replies

Jan 18, 2010 9:13 PM in response to Charles Minow

I wouldn't expect sips to re-compress the image if I'm only adding the color profile and no other modifications.
Here's the test case in terminal:

jphelps-mbp:test jphelps$ ls -al
total 6288
drwxr-xr-x 3 jphelps staff 102 Jan 18 23:05 .
drwxr-xr-x 22 jphelps staff 748 Jan 18 23:05 ..
-rwxr-xr-x 1 jphelps staff 3215479 Jan 18 23:05 IMG_5387.JPG
jphelps-mbp:test jphelps$ sips -e "/System/Library/ColorSync/Profiles/sRGB Profile.icc" IMG_5387.JPG --out IMG_5387b.JPG
/Users/jphelps/Desktop/export/test/IMG_5387.JPG
/Users/jphelps/Desktop/export/test/IMG_5387b.JPG
jphelps-mbp:test jphelps$ ls -al
total 9400
drwxr-xr-x 4 jphelps staff 136 Jan 18 23:06 .
drwxr-xr-x 22 jphelps staff 748 Jan 18 23:05 ..
-rwxr-xr-x 1 jphelps staff 3215479 Jan 18 23:05 IMG_5387.JPG
-rw-r--r-- 1 jphelps staff 1590514 Jan 18 23:06 IMG_5387b.JPG

Jan 19, 2010 9:10 PM in response to jphelp32

jphelp32 wrote:
I wouldn't expect sips to re-compress the image if I'm only adding the color profile and no other modifications.


I'm pretty confident it is re-compressing the JPEG. Here's how I tested it:

1. Add a color profile to a JPEG, just like you did.

2. Take that JPEG and load it, along with the original JPEG, into Photoshop in the same file, in different layers. Change the mode of the top layer to "Difference" and flatten the file. The picture looks like it's all black, but it's not.

3. Use a tool, like the levels adjustment, to increase the contrast. Where the two pictures differ, there will be "noise" in the picture.

However, if I duplicate a JPEG in the Finder, import the Finder duplicate and the original, and repeat steps 2 and 3, I get a black picture, no noise in it at all regardless of how much I mess with the levels.

You can change the compression level sips uses by using " -s formatOptions" and then one of low, normal, high, best , or a numerical percentage. That will also change the size of your file...

charlie

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

sips --embedProfile is reducing jpeg file size by half

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.