cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Confused by metadata (e.g., BitsPerSample)

aajax
Enthusiast

It seems that the software provided by Canon is NOT as complete as it could be when dealing with metadata. Therefore, I've been using a number of tools that rely on a program called ExifTool for accessing/viewing metadata associated with image files related to my photographs. The specifications (per user manual) for my camera includes a line as follows:

 

  • Image Type: JPEG, RAW (14 bit Canon original)

I have my camera set to produce raw files thinking that this produces files that contain more precision than the 8 bit limit associated with the JPEG specification and allows more latitude for the software used to develop the photos. However, the metadata associated with these raw files include an element within the group identified as EXIF:IFD0 which contains a tag named BitsPerSample with a value of "8 8 8". To be sure metadata is a complicated subject easy to misunderstand but it is my understanding the IFD0 refers to what is called the main image. As it happens these same raw files also include an element within the group identified as EXIF:IFD2 which contains a tag named BitsPerSample with a value of "16 16 16". I'm having some trouble determining the specific purpose of the EXIF:IFD2 group but based on what appear to be related values of "668" and "432" for ImageWidth and ImageHeight, respectively, I'm thinking this could pertain to a thumbnail. It would make some sense to me if the thumbnail where limited to 8 bits per sample even when the main image was 16 bits per sample. However, I can make no sense out of what's presently there.

 

It would be nice if Canon had some reference documentation, for those who might be interested, that elaborates on the meaning of all the metadata that their cameras record in the produced image files. Is that possible?

 

Anyway, can someone explain how to interpret these various elements called "BitsPerSample" that get recorded in Canon's raw files. Filetype is CR2 if that matters.

1 ACCEPTED SOLUTION

ebiggs1
Legend

"Problem here is that you can NOT record 14bits of color depth with 8bits."

 

The high bit depth of the Raw image is converted into 8-bits per channel in the jpg, so don't convert to a jpg. Remember, all images start out as Raw, it's just what happens to it after the capture that is important.

EB
EOS 1DX and 1D Mk IV and several lenses!

View solution in original post

12 REPLIES 12

rs-eos
Elite

I believe that all RAW files are ultimately proprietary and that's it's going to a tall order to get any documentation from any vendor on the actual file format.

 

Yes, Adobe effectively figures things out for ACR (Adobe Camera RAW), but still, that's going to involve some serious deep data dives.

 

Is there a specific reason you need to understand the actual structure/data of Canon RAW?  e.g. are you attempting to write your own software for some specific purpose?

--
Ricky

EOS 5D IV, EF 50mm f/1.2L, EF 135mm f/2L, 600EX-RT (x6), ST-E3-RT
EOS C70, RF 24-70 f/2.8L IS, EF-EOS R 0.71x

The particular interest in BitsPerSample came about because my work flow ends up producing developed images in lots of different formats.  This includes both tiff and png which each support both 8 (some would say 24) bit & 16 (48) bit formats.  In this case the 8 & 16 refer to the maximum resolution that the format is capable of accomodating.  I'm trying to find a metadata tag that I can display in list of image files that serves the purpose of quickly and ?accurately informing about those differences in format.  Since I found mutliple different tags with values for BitsPerSample in some files an obvious question becomes "what's the difference?".  I think the tag referenced as EXIF:IFD0:BitsPerSample looks to be doing the job.  However, I did NOT expect a value of [8 8 8] for my raw files for the reasons previously stated.  In that, raw is supposed to provide more color depth than what can be encoded in 8bits.  My camera specs imply it can capture up to 14 bits.

 

That brings us to the difference between what the camera sensor is capable of detecting (14bits?) and what the file format is capable of supporting (8bits).  In that, if it had said 16bits I'd have taken that to mean the file format rather than sensor capability.  Problem here is that you can NOT record 14bits of color depth with 8bits.  When I discovered another IFD2:BitsPerSample that showed as [16 16 16] this became particularly puzzling.

 

Also, went and found some images where I had the camera record both raw & jpg.  It turns out the there is NO IFD0:BitsPerSample tag at all even though that should be the case where [8 8 8] might be correct.  Also puzzling.

 

Insofar as the camera is creating this data one might think that Canon could tell its' customers what it means.

 

 

Interesting that the web site claims that information is licensed under creative commons.  I don't think Canon would have licensed out their format to being with 🙂  Thus, this appears to be work of reverse engineering which are usually called out to be forbidden in license agreements.

--
Ricky

EOS 5D IV, EF 50mm f/1.2L, EF 135mm f/2L, 600EX-RT (x6), ST-E3-RT
EOS C70, RF 24-70 f/2.8L IS, EF-EOS R 0.71x

I'll need to spend a little more time reviewing that information but this is something I like knowing how to find. Thank you for that.

Based on some preliminary review it somewhat appears as though IFD0:BitsPerSample is set to a constant value of [8 8 8] which essentially would make it meaningless. Maybe it helps avoid processing problems for some software. However, I'd think that if this assessment is correct end users (i.e., customers) ought to be able to know that.

Of course, RAWS don't have "color depth" since the raw data is strictly monochrome, so it would make no sense to have 3 8-bit channels.

Raw files contain one red, green, or blue value at each pixel location.  A Raw file contains all the info to make a color picture. The big difference is whether you let the camera make the conversion or you let the computer do the conversion. Almost all in-camera settings that affect image adjustments are irrelevant when shooting In Raw format.  That is why a B&W Raw photo shows up as a color picture in some converters for instance.  They don't read the B&W flag set in the meta data by the camera.  So they display the color read from each red, green, or blue pixel location.

EB
EOS 1DX and 1D Mk IV and several lenses!

ebiggs1
Legend

"It would be nice if Canon had some reference documentation, ..."

 

That ain't gonna happen.  Don't you think Adobe would love that?

EB
EOS 1DX and 1D Mk IV and several lenses!

ebiggs1
Legend

"Problem here is that you can NOT record 14bits of color depth with 8bits."

 

The high bit depth of the Raw image is converted into 8-bits per channel in the jpg, so don't convert to a jpg. Remember, all images start out as Raw, it's just what happens to it after the capture that is important.

EB
EOS 1DX and 1D Mk IV and several lenses!
Announcements
08/18/2023: Canon EOS R5 C training series is released.

07/31/2023: New firmware updates are available.

CR-N700 - Version 1.2.0

CR-N500 - Version 1.3.0

CR-N300 - Version 1.3.0

CR-X300 - Version 1.1.0


06/30/2023: New firmware version 1.0.5.1 is available for EOS-R5 C

05/31/2023: New firmware updates are available.

EOS R6 Mark II - Version 1.1.2

EOS R6 - Version 1.8.2

EOS R7 - Version 1.3.1


05/18/2023: New firmware updates are available.

EOS Rebel T100 - Version 1.1.0

EOS Rebel T7 - Version 1.2.0

EOS 5D Mark IV - Version 1.4.0

EOS 6D Mark II - Version 1.2.0

PowerShot Elph 360HS - Version 1.1.0.0

PowerShot SX420 IS - Version 1.1.0.0

PowerShot 620 HS - Version 1.1.0.0

PowerShot SX720 HS - Version 1.1.0.0

PowerShot G1X Mark III - Version 1.1.0.0

PowerShot G7X Mark II - Version 1.2.0.0

PowerShot G9X Mark II - Version 1.1.0.0

 

04/20/2023: New firmware version 1.4.1 is available for EOS R3

03/30/2023: New firmware updates are available.

EOS R5 - Version 1.8.1

EOS 1DX Mark III- Version 1.7.1

Speedlite EL-1 - Version 1.0.2

03/30/2023: Product Advisory for EF50 F1.2 L USM

03/30/2023: Product Advisory for EOS R10


02/24/2023: We've updated Share Your Photos

2/07/2023: New product announcements!

EOS R8 EOS R50RF-S55-210mm F5-7.1 IS STMRF24-50mm F4.5-6.3 IS STMRF15-30mm F4.5-6.3 IS STM
01/09/2023: Help ensure your autofocus is properly aligned with a Canon Precision Alignment
01/03/2023: Welcome to CES 2023!
12/08/2022: New firmware version 1.0.5.1 is available for EOS C70
12/07/2022: New firmware version 1.7.0 is available for EOS R5