Brian
Brian

Reputation: 38025

How do i remove embedded color profile from jpg image?

I've got a jpeg photo that seems to have a filter in it. Depending on what viewer I use, the image appears darker than it should. I didn't realize that jpegs could include something like that, but it seems it must.

Original: Original Image

Resized (notice it is darker): Resized Image

How can I strip the filter out or ignore it when resizing the image in C#? I wouldn't mind an explanation of how this happens as well. The image was supplied by a user, but I don't know how this filter was added to it (I didn't realize the jpeg format supported things like that).

Upvotes: 7

Views: 11741

Answers (1)

U. Windl
U. Windl

Reputation: 4325

Using the command exiftool the command to execute would be exiftool -ICC_Profile= photo.jpg.

Actually before doing so I did extract the profile before removal (exiftool would create a backup though) using the command exiftool -icc_profile -b -w icc photo.jpg. That would create photo.icc. Inspecting that using exiftool photo.icc showed that the profile is a Wide-Gamut

...
display profile (AdobeRGB):
Profile CMM Type                : KCMS
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 1998:12:01 18:58:21
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : KODA
Device Model                    : ROMM
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82487
Profile Creator                 : KODA
Profile ID                      : 0
Profile Copyright               : Copyright (c) Eastman Kodak Company, 1999, all rights reserved.
Profile Description             : ProPhoto RGB
Media White Point               : 0.9642 1 0.82489
...
Red Matrix Column               : 0.79767 0.28804 0
Green Matrix Column             : 0.13519 0.71188 0
Blue Matrix Column              : 0.03134 9e-005 0.82491
Device Mfg Desc                 : KODAK
Device Model Desc               : Reference Output Medium Metric(ROMM)
...

Removing the profile would not make it look better in most cases, however; the proper way would be to apply profile correction to the image data (like converting it from AdobeRGB to sRGB). Maybe you want to look at How can one perform color transforms with ICC profiles on a set of arbitrary pixel values (not on an image data structure)?.

In general photos with AdobeRGB profile look a bit dull on non-wide-gamut displays (sRGB), and some programs do not apply the profiles correctly (like Windows 7 build-in image viewer). In general Firefox does a good job unless using ICCv4 profiles (work in progress).

But as you asked for it (and for people to see the differences or not), here's the photo without a profile (BTW: I viewed your images with a wide-gamut display, so the first one did not look bad on it): enter image description here

Upvotes: 1

Related Questions