Author Topic: Unbalanced colors in .dng, .mp4 files  (Read 20092 times)

mtrovato

  • Newbie
  • *
  • Posts: 6
    • View Profile
Unbalanced colors in .dng, .mp4 files
« on: April 12, 2022, 01:26:43 PM »
Dear all,

images look nice when viewing from the camera. However, the colors of .dng (and .mp4) files are completely unbalanced when opening them offline with editors like preview (macOs) or shotwell (centos7). After adjusting the colors images look decent. See an example here:  https://anl.box.com/s/r0z9z2a5hczfgywobr0ekr3kkoa5wtfo

Is the color profile embedded in .dng and .mp4 files? If so, which software should I use to open them? I am guessing that it is a problem of software interpretation

Thanks
Best,
Marco

Nikon1

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Unbalanced colors in .dng, .mp4 files
« Reply #1 on: April 13, 2022, 02:17:51 PM »
Short on time rn, so i just leave this here, hope this helps any, else just post any left over Questions again:
 https://forum.krontech.ca/index.php?topic=687.msg4734#msg4734 
(LUT is for 0.7.0, meanwhile 0.7.1 is released, in which the Color was somewhat fixed/ changed/ improved, so might not work anymore/ as well, but you can easily make you own LUT with a Color-Checker)
« Last Edit: April 13, 2022, 02:20:21 PM by Nikon1 »

mtrovato

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Unbalanced colors in .dng, .mp4 files
« Reply #2 on: April 14, 2022, 08:06:53 AM »
Thanks. I have no experience with DaVinci Resolve or similar softwares but I will dig into it. In any case I gather from your answer that indeed an offline correction (LUT) is needed

Meanwhile I was able to adjust the photo brightness and achieve similar results as shotwell by the simple script below

import cv2
import numpy as np

def change_brightness(img, value=30):
    hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    h, s, v = cv2.split(hsv)                                                                                                                                                       
    v = cv2.multiply(v,value)
    v[v > 255] = 255
    v[v < 0] = 0
    final_hsv = cv2.merge((h, s, v))
    img = cv2.cvtColor(final_hsv, cv2.COLOR_HSV2BGR)
    return img


img = cv2.imread('./frame_notadjusted.jpg')                                                                                                                                       
img = change_brightness(img, value=5)                                                                                                                         
cv2.imwrite('ColorAdjusted_py.jpg', img)
« Last Edit: April 14, 2022, 08:10:45 AM by mtrovato »

Nikon1

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Unbalanced colors in .dng, .mp4 files
« Reply #3 on: April 14, 2022, 08:13:09 AM »
Thanks. I have no experience with DaVinci Resolve or similar softwares but I will dig into it.

Meanwhile I was able to adjust the photo brightness and achieve similar results as shotwell by the simple script below

import cv2
import numpy as np

def change_brightness(img, value=30):
    hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    h, s, v = cv2.split(hsv)                                                                                                                                                       
    v = cv2.multiply(v,value)
    v[v > 255] = 255
    v[v < 0] = 0
    final_hsv = cv2.merge((h, s, v))
    img = cv2.cvtColor(final_hsv, cv2.COLOR_HSV2BGR)
    return img


img = cv2.imread('./frame_notadjusted.jpg')                                                                                                                                       
img = change_brightness(img, value=5)                                                                                                                         
cv2.imwrite('ColorAdjusted_py.jpg', img)

 Can you explain whatever is happening there? I on the other Hand probably know less about code than you about Editing Software, but just from looking at it, is this basically just some kind of Color Space Conversion from HSV Color Space to RGB Color Space or something? If that seems To fix the Problem you are having, that might be a clue to what is wrong in the Color Science of the Camera? would be worth looking into at least, i guess.
 Thanks however for Sharing anyways, even though i have no clue at all of what i am looking at.

mtrovato

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Unbalanced colors in .dng, .mp4 files
« Reply #4 on: April 14, 2022, 10:42:18 AM »

 Can you explain whatever is happening there? I on the other Hand probably know less about code than you about Editing Software, but just from looking at it, is this basically just some kind of Color Space Conversion from HSV Color Space to RGB Color Space or something? If that seems To fix the Problem you are having, that might be a clue to what is wrong in the Color Science of the Camera? would be worth looking into at least, i guess.
 Thanks however for Sharing anyways, even though i have no clue at all of what i am looking at.


Sure I can. Basically I am retrieving the brightness from the HSV color space of the photo, multiply by 5 (eyeballed value to get similar results if compared to shotwell output) and save the modify image.  I have done something similar in DaVinci Resolve: I have reduce the brightness range in the Colors/Curves - Custom and I get nice results (see Keys.mov in the same folder)


I am bit puzzled by your answer though, as it seems that my camera may have issues.  As far as I understand from this thread prior to your last answer is that LUTs are needed to correctly view .dng/.mp4 files. This is not a bug in the camera but rather a compatibility issue between the camera and the offline software (shotwell/DaVinci, etc...). Also live videos/photos appear very nice on the camera screen

Nikon1

  • Hero Member
  • *****
  • Posts: 985
    • View Profile
Re: Unbalanced colors in .dng, .mp4 files
« Reply #5 on: April 14, 2022, 11:14:53 AM »
Thanks, will have a look at that, and play with those Settings myself, if i have a bit of spare time.
 .
 I dont really think its correctly described as compatibility issues. Color Science and all the Different Color Spaces are one Hell of a Beast to tackle or even to grasp somewhat at all, here is just some Papers, explaining the very basics of it:
 https://www.xritephoto.com/documents/literature/en/L11-176_Guide_to_CM_en.pdf
 https://xritephoto.com/documents/literature/en/L11-029_color_guide_EN.pdf
 .
 Comes down to a lot of things, as Color is also a lot up to interpretation like for example just White Balance. Then also the Fact, that DNG is a RAW Format, which currently does not seem to have a Color Profile/ Preset embedded, meaning it is what the Camera actually sees, and the mp4 Compressed Output would be a lot closer to what it shows you on the Screen, as that has all Color Settings fully baked in.
 ALSO (tbf. dont know about newer ones, heard the current batches of Chronos Cameras will get a much improved Internal Screen, though i cant speak for those, as i still only know the default "Version 1.0" Screen of the 2.1 and the very original 1.4 Screen), the Screen isnt Terribly color Accurate.
 If you want to actually get displayed what the Camera Sees, use a Calibrated or at least very Color Accurate External HDMI Screen to Shoot anything (i use a 502 Bright SmallHD On-Camera Monitor, which is accurate enough for my use).
 .
 And this is not really a Issue with the Chronos Camera really, plenty of different Cameras have quite different opinions on how things look or have to look.
 Just look at Color Comparisons between Shots from Canon, Nikon, Pentax, Sony, Panasonic, and some Cine-Cameras (plenty of those Kinds of Comparisons online and on YT), when unbalanced, without any Color Matching or Color Correction done. There is Quite a lot of Subjectivity about Color tbh.
 And given, you probably usually Stick to your Brand of Camera mostly, you kind of know what you will get and what to expect from the "Look" you get from it, cause you are used to it.
 Have heard People call Nikon Cameras "Yellow Picture Camera", and not only because of the color of their Company Logo, but also because they say that their Footage and Images are way to Yellow biased, and so on.
 And Brands like Nikon do put plenty of Effort in their Color Science, and some People still complain.
 .
 If you want truly Repeatable Colors, especially between different Colors and / or in different lighting Situations, there is pretty much no way around a Color Calibration Target of some Kind, like those Color-Checkers (which i use for any Shot i do on the Chronos! have never used one ever before getting my Chronos, but with the 2.1, i kind of need to use it to get accurate Colors. Camera can and will produce very usable Results without, but color can look quite different from Other Cameras, when Shooting the Same Scene.).
 I do still hope, that Color Science at Krontech does improve Further, so you would still get something a bit closer to most Mainstream Cameras in terms of Color without using a color-Checker on every single Shot/ Light Change, but i mean for now its usable enough. Especially if you find yourself in a lot of Similar Light-Situations, you could Probably Mostly reuse the Same Settings or just make a LUT or Preset for your Color Correction if you do end up using it for Studio Lighting, and get pretty much perfect Color with no additional work other than Slapping your Color Correction on every time (gonna have to do some kind of Grading/ Color work anyways, if shooting DNG, else you would probably just go with .mp4 for Basic Footage output).
« Last Edit: April 15, 2022, 01:06:09 PM by Nikon1 »