imread seems to alter the image saturation?

3 次查看(过去 30 天)
Why does the image read by imread() seem to have a reduced saturation compared to the original image? This also happens when the image is read through an imageDatastore object, I guess the underlying method is still imread(). The codes I used are included below:
img = imread("img_original.jpg");
figure, imshow(img)
which produce something like this:
while the original image file, open in FastStone looks like this:
You can also open the img_original.jpg to see it yourself.
While inspecting the histogram, I see that the blue channel has been altered the most when comparing to the histogram from FastStone. The original image seems to have a lot of blue pixels saturated at 0, while the Matlab's blue histogram shows a slight shift to the right. This is also evident from the red channel.
Factors I have investigated include:
  • bit-depth
  • JPG format
  • imread optional arguments
  • Monitor display setting: the colour histogram is evident that colour has changed
  • FastStone: I also tried the default Windows image viewer and it looks the same as in FastStone
Can someone please explain what may cause this colour discrepancy when I just simply read the image? Thank you!
  4 个评论
Steven Pan
Steven Pan 2024-2-28
I believe I found the reason. Turns out the FastStone image viewer may have added extra saturation to enhance the image and makes it more appealing (like many other image viewing software do). However, if you try something like IrfanView you should see the same colour viewed in Matlab. I will attach a comparison here. Therefore, the slightly dull colour from Matlab is the "true" colour of this image.
DGM
DGM 2025-8-25
This image has a ton of metadata from Lightroom, describing color and tone adjustments. It may be that those are simply not applied unless the application reads the tags and applies them to the image after decoding. I can't even find documentation for what all these tags mean, so it's anyone's guess whether they are instructive of what needs to be applied, or merely documentation of what's already been applied. If they need to be applied, how should they be interpreted? What, mathematically, does +7 clarity even mean?
For example, these look like they're not neutral parameters, but who knows how they should be applied or whether they've been applied already.
  • Tint : +13
  • Exposure 2012 : +0.70
  • Contrast 2012 : +23
  • Highlights 2012 : +18
  • Shadows 2012 : +100
  • Whites 2012 : +7
  • Blacks 2012 : 0
  • Texture : +21
  • Clarity 2012 : +7
  • Dehaze : +14
Who knows what this LUT is for, but that's definitely a nonlinear tone curve. It's not enough to explain the other other changes to the color.
  • Look Parameters Look Table : E1095149FDB39D7A057BAB208837E2E1
  • Look Parameters Tone Curve PV2012: 0, 0, 22, 16, 40, 35, 127, 127, 224, 230, 240, 246, 255, 255

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by