简体   繁体   English

如何从jpg图像中删除嵌入的颜色配置文件?

[英]How do i remove embedded color profile from jpg image?

I've got a jpeg photo that seems to have a filter in it. 我有一张jpeg照片,里面似乎有一个滤镜。 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. 我没有意识到jpeg可以包含类似的内容,但似乎必须如此。

Original: 原版的: 原始图片

Resized (notice it is darker): 调整大小(注意它更暗): 调整大小的图像

How can I strip the filter out or ignore it when resizing the image in C#? 在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). 该图像是由用户提供的,但是我不知道该过滤器是如何添加到其中的(我不知道jpeg格式支持这种东西)。

Using the command exiftool the command to execute would be exiftool -ICC_Profile= photo.jpg . 使用命令exiftool可以执行的命令是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 . 实际上,在执行此操作之前,我确实使用命令exiftool -icc_profile -b -w icc photo.jpg提取了配置文件,然后将其删除(exiftool会创建备份)。 That would create photo.icc . 那将创建photo.icc Inspecting that using exiftool photo.icc showed that the profile is a Wide-Gamut 使用exiftool photo.icc检查显示配置文件是宽色域

...
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). 正确的方法是将轮廓校正应用于图像数据(例如将其从AdobeRGB转换为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)? 也许您想看看如何使用ICC配置文件对一组任意像素值(而不是图像数据结构)执行颜色转换? .

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). 通常,具有AdobeRGB配置文件的照片在非全色显示器(sRGB)上看起来有些沉闷,并且某些程序无法正确应用配置文件(例如Windows 7内置图像查看器)。 In general Firefox does a good job unless using ICCv4 profiles (work in progress). 通常,除非使用ICCv4配置文件(正在进行中),否则Firefox会做得很好。

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): 但是,按照您的要求(供人们查看差异与否),这是没有配置文件的照片(顺便说一句:我使用宽色域显示器查看了您的图像,因此第一个看起来并不差): 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM