Author Topic: [SOLVED] How to edit Black level of .RAW File?  (Read 3610 times)

fatpig

  • Member
  • ***
  • Posts: 163
[SOLVED] How to edit Black level of .RAW File?
« on: June 17, 2013, 10:40:02 PM »
Hello,

One of my .RAW clips from the 5DII has Black Level of 2293 instead of 1024, as reported by RAW2CDNG-
How can I edit this?

All conversion apps make it ugly green looking as a result.
Thanks! :)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11517
  • 5D Mark Free
Re: How to edit Black level of .RAW File?
« Reply #1 on: June 17, 2013, 11:49:31 PM »
The easy way:

    exiftool -BlackLevel=1000 1234.dng

The hard way:

    raw_info.black_level = 1234; // in raw2dng.c




fatpig

  • Member
  • ***
  • Posts: 163
Re: How to edit Black level of .RAW File?
« Reply #2 on: June 18, 2013, 10:38:00 AM »
exiftool reports a problem when trying on cinemaDNG, aswell as normal DNG.
"error reading image data"
source .RAW file also cant be edited... unsupported file type.


so there is no way to correct it inside the .RAW?
I dont understand the second method. I assume I need a compiler for that?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11517
  • 5D Mark Free
Re: How to edit Black level of .RAW File?
« Reply #3 on: June 18, 2013, 10:42:50 AM »
On raw2dng output it works.

With the hex editor, figure out the offset of black_level, or just append a video file that has the correct level, and a little more frames.

chmee

  • Hero Member
  • *****
  • Posts: 1031
  • raw2cdng
Re: How to edit Black level of .RAW File?
« Reply #4 on: June 18, 2013, 07:20:01 PM »
the lovely hard way is, to change the value in the datafield in the raw-file. if you're firm in using a hexfile editor (hxd) you're looking in the end of the file, there are the metadata to the raws.

convert your actual blacklevel to hex, revert the byteorder and search them.. (lol. thats the easy way instead of counting offsets :) )
(int2hex calculator http://www.sql-und-xml.de/unicode-database/online-tools/)

in my example (int)2046 is (hex) 7fe (07FE) -> FE 07.
calculate your desired blacklevel and hack it in :) (two times..)



regards chmee

fatpig

  • Member
  • ***
  • Posts: 163
Re: How to edit Black level of .RAW File?
« Reply #5 on: June 18, 2013, 11:57:45 PM »
hey thanks, that is really helpful! will do :)

EDIT: It worked! Thanks so much!
curiously, there was only one instance of my blacklevel. changing that helped. :)