Resetting the Black Level of DNG files.

Started by Osimages, April 09, 2014, 10:14:49 PM

Previous topic - Next topic

Osimages

Hi

I'm very new to exiftool but have achieved some success. I have just completed 2 conversions of the same Magic Lantern Raw file from a 5D III. Firstly with RawMagic 1.0 Beta 4 (64 bit) and then with Mystic.

I'm on a mac running 10.9.2 and Exiftool 9.56.

Here is the meta data from each conversion.

RawMagic.

---- ExifTool ----
ExifTool Version Number         : 9.56
---- System ----
File Name                       : M08-1705_00001.dng
Directory                       : /Users/nickosborne/Desktop/Junk/Raw Magic/M08-1705
File Size                       : 4151296
File Modification Date/Time     : 2014:04:10 11:56:18+10:00
File Access Date/Time           : 2014:04:10 11:56:18+10:00
File Inode Change Date/Time     : 2014:04:10 11:56:18+10:00
File Permissions                : 644
---- File ----
File Type                       : DNG
MIME Type                       : image/x-adobe-dng
Exif Byte Order                 : II
---- IFD0 ----
Subfile Type                    : 0
Image Width                     : 1920
Image Height                    : 1080
Bits Per Sample                 : 16
Compression                     : 1
Photometric Interpretation      : 32803
Fill Order                      : 1
Strip Offsets                   : 4096
Orientation                     : 1
Samples Per Pixel               : 1
Rows Per Strip                  : 1080
Strip Byte Counts               : 4147200
Planar Configuration            : 1
Software                        : Rarevision RAWMagic 1.0
CFA Repeat Pattern Dim          : 2 2
CFA Pattern 2                   : 0 1 1 2
DNG Version                     : 1 1 0 0
Unique Camera Model             : Canon EOS 5D Mark III
Black Level                     : 2047
White Level                     : 15000
Default Crop Origin             : 0 0
Default Crop Size               : 1920 1080
Color Matrix 1                  : 0.6722 -0.0635 -0.0963 -0.4287 1.246 0.2028 -0.0908 0.2162 0.5668
Color Matrix 2                  : 0.6722 -0.0635 -0.0963 -0.4287 1.246 0.2028 -0.0908 0.2162 0.5668
As Shot Neutral                 : 1 2.045 1.35
Frame Rate                      : 25
---- Composite ----
CFA Pattern                     : 2 2 0 1 1 2
Image Size                      : 1920x1080


Now Data from Mystic.

---- ExifTool ----
ExifTool Version Number         : 9.56
---- System ----
File Name                       : M08-1705.000001.dng
Directory                       : /Users/nickosborne/Desktop/Junk/Mystic/M08-1705
File Size                       : 3662848
File Modification Date/Time     : 2014:04:10 12:03:22+10:00
File Access Date/Time           : 2014:04:10 12:04:19+10:00
File Inode Change Date/Time     : 2014:04:10 12:03:23+10:00
File Permissions                : 644
---- File ----
File Type                       : DNG
MIME Type                       : image/x-adobe-dng
Exif Byte Order                 : II
---- IFD0 ----
Subfile Type                    : 1
Image Width                     : 128
Image Height                    : 84
Bits Per Sample                 : 8 8 8
Compression                     : 1
Photometric Interpretation      : 2
Image Description               :
Make                            : Canon
Camera Model Name               : Canikon
Strip Offsets                   : 1536
Orientation                     : 1
Samples Per Pixel               : 3
Rows Per Strip                  : 84
Strip Byte Counts               : 32256
Planar Configuration            : 1
Software                        : Magic Lantern
Modify Date                     :
Artist                          :
Copyright                       :
TIFF-EP Standard ID             : 1 0 0 0
Serial Number                   :
Lens Model                      :
DNG Version                     : 1 3 0 0
DNG Backward Version            : 1 3 0 0
Unique Camera Model             : Canikon
Color Matrix 1                  : 0.6722 -0.0635 -0.0963 -0.4287 1.246 0.2028 -0.0908 0.2162 0.5668
Analog Balance                  : 1 1 1
As Shot Neutral                 : 0.473635 1 0.624
Baseline Exposure               : undef
Baseline Noise                  : 1
Baseline Sharpness              : 1.333333333
Linear Response Limit           : 1
Calibration Illuminant 1        : 21
Calibration Illuminant 2        : 21
Frame Rate                      : 25
---- SubIFD ----
Subfile Type                    : 0
Image Width                     : 1920
Image Height                    : 1080
Bits Per Sample                 : 14
Compression                     : 1
Photometric Interpretation      : 32803
Strip Offsets                   : 33792
Samples Per Pixel               : 1
Rows Per Strip                  : 1080
Strip Byte Counts               : 3629056
X Resolution                    : 180
Y Resolution                    : 180
Planar Configuration            : 1
Resolution Unit                 : 2
CFA Repeat Pattern Dim          : 2 2
CFA Pattern 2                   : 0 1 1 2
Black Level                     : 2047
White Level                     : 15000
Default Crop Origin             : 0 0
Default Crop Size               : 1920 1080
Active Area                     : 0 0 1080 1920
Opcode List 1                   : (Binary data 28 bytes, use -b option to extract)
---- ExifIFD ----
Exposure Time                   : 0
F Number                        : 0
Exposure Program                : 0
ISO                             : 0
Exif Version                    : 0221
Date/Time Original              :
Shutter Speed Value             : 1
Aperture Value                  : 1
Exposure Compensation           : 0
Max Aperture Value              : 1
Metering Mode                   : 0
Flash                           : 0
Focal Length                    : 0
Sub Sec Time                    :
Sub Sec Time Original           :
Focal Length In 35mm Format     : 0
---- Composite ----
CFA Pattern                     : 2 2 0 1 1 2
Image Size                      : 1920x1080
Shutter Speed                   : 0
Focal Length                    : 0

Now to the problem.

I'm using the command


exiftool -overwrite_original -BlackLevel=2048 image.dng


which works fine for the Mystic converted file but leaves the file unchanged for the RawMagic files.

Where am I going wrong?

Thanks in advance.

Nick.

Phil Harvey

Hi Nick,

If you use the -v2 option or consult the EXIF tags documentation you should be able to figure this out.  The default write location for BlackLevel is in the SubIFD, but there is no SubIFD in your RawMagic file.  For this file you need to specify IFD0:BlackLevel.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Osimages

Hi Phil and thanks for the prompt reply.

I'm still having a problem. (not enough command line skills!)

Here is the result

nicks-mbp-2:~ nickosborne$ exiftool IFD0:BlackLevel=2048 -v2 /Users/nickosborne/Desktop/Junk/Raw\ Magic/M08-1705/M08-1705_00000.dng
File not found: IFD0:BlackLevel=2048
======== /Users/nickosborne/Desktop/Junk/Raw Magic/M08-1705/M08-1705_00000.dng
  ExifToolVersion = 9.56
  FileName = M08-1705_00000.dng
  Directory = /Users/nickosborne/Desktop/Junk/Raw Magic/M08-1705
  FileSize = 4151296
  FileModifyDate = 1397094978
  FileAccessDate = 1397169635
  FileInodeChangeDate = 1397094978
  FilePermissions = 33188
  FileType = DNG
  MIMEType = image/x-adobe-dng
  ExifByteOrder = II
  + [IFD0 directory with 26 entries]
  | 0)  SubfileType = 0
  |     - Tag 0x00fe (4 bytes, int32u[1])
  | 1)  ImageWidth = 1920
  |     - Tag 0x0100 (4 bytes, int32u[1])
  | 2)  ImageHeight = 1080
  |     - Tag 0x0101 (4 bytes, int32u[1])
  | 3)  BitsPerSample = 16
  |     - Tag 0x0102 (2 bytes, int16u[1])
  | 4)  Compression = 1
  |     - Tag 0x0103 (2 bytes, int16u[1])
  | 5)  PhotometricInterpretation = 32803
  |     - Tag 0x0106 (2 bytes, int16u[1])
  | 6)  FillOrder = 1
  |     - Tag 0x010a (2 bytes, int16u[1])
  | 7)  StripOffsets = 4096
  |     - Tag 0x0111 (4 bytes, int32u[1])
  | 8)  Orientation = 1
  |     - Tag 0x0112 (2 bytes, int16u[1])
  | 9)  SamplesPerPixel = 1
  |     - Tag 0x0115 (2 bytes, int16u[1])
  | 10) RowsPerStrip = 1080
  |     - Tag 0x0116 (4 bytes, int32u[1])
  | 11) StripByteCounts = 4147200
  |     - Tag 0x0117 (4 bytes, int32u[1])
  | 12) PlanarConfiguration = 1
  |     - Tag 0x011c (2 bytes, int16u[1])
  | 13) Software = Rarevision RAWMagic 1.0
  |     - Tag 0x0131 (24 bytes, string[24])
  | 14) CFARepeatPatternDim = 2 2
  |     - Tag 0x828d (4 bytes, int16u[2])
  | 15) CFAPattern2 = 0 1 1 2
  |     - Tag 0x828e (4 bytes, int8u[4])
  | 16) DNGVersion = 1 1 0 0
  |     - Tag 0xc612 (4 bytes, int8u[4])
  | 17) UniqueCameraModel = Canon EOS 5D Mark III
  |     - Tag 0xc614 (256 bytes, string[256])
  | 18) BlackLevel = 2047
  |     - Tag 0xc61a (2 bytes, int16u[1])
  | 19) WhiteLevel = 15000
  |     - Tag 0xc61d (2 bytes, int16u[1])
  | 20) DefaultCropOrigin = 0 0
  |     - Tag 0xc61f (4 bytes, int16u[2])
  | 21) DefaultCropSize = 1920 1080
  |     - Tag 0xc620 (4 bytes, int16u[2])
  | 22) ColorMatrix1 = 0.6722 -0.0635 -0.0963 -0.4287 1.246 0.2028 -0.0908 0.2162 0.566[snip]
  |     - Tag 0xc621 (72 bytes, rational64s[9])
  | 23) ColorMatrix2 = 0.6722 -0.0635 -0.0963 -0.4287 1.246 0.2028 -0.0908 0.2162 0.566[snip]
  |     - Tag 0xc622 (72 bytes, rational64s[9])
  | 24) AsShotNeutral = 1 2.045 1.35 (1000/1000 2045/1000 1350/1000)
  |     - Tag 0xc628 (24 bytes, rational64u[3])
  | 25) FrameRate = 25 (25000/1000)
  |     - Tag 0xc764 (8 bytes, rational64s[1])
    1 image files read
    1 files could not be read

I know it's something basic but it's beyond me.

Cheers

Nick

Phil Harvey

Quote from: Osimages on April 10, 2014, 06:47:14 PM
File not found: IFD0:BlackLevel=2048

You forgot a dash before the tag name, which is a different problem entirely.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Osimages

Thanks Phil.

That worked. (I'm slowly and I mean slowly getting it!)

Nick