cancel
Showing results for 
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
Whiz

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.

 

 

kvbarkley
VIP

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
06/10/2022: Service Notice:UPDATE: Canon Inkjet Printer continuous reboot loop or powering down
06/07/2022: New firmware version 1.3.2 is available for PowerShot G7 X Mark III
06/07/2022: New firmware version 1.0.3 is available for EOS M50 Mark II
05/31/2022: Did someone SAY Badges?
05/26/2022: New firmware version 1.0.5.1 is available for EOS-C500 Mark II
05/26/2022: New firmware version 1.0.3.1 is available for EOS-C300 Mark III
05/10/2022: Keep your Canon gear in optimal condition with a Canon Maintenance Service
05/05/2022: We are excited to announce that we have refreshed the ranking scale within the community!
04/26/2022: New firmware version 1.0.1.1 is available for EOS R5 C
03/23/2022: New firmware version 1.0.3.1 is available for EOS-C70
03/22/2022: New firmware version 1.2.0 is available for PowerShot PICK
03/16/2022: New firmware version 1.5.2 is available for EOS-R5
03/16/2022: New firmware version 1.5.2 is available for EOS-R6
02/09/2022: Share Your Photos is back!
02/07/2022: New firmware version 1.1.1 is available for EOS-R3
02/07/2022: New firmware version 1.6.1 is available for EOS-1DX Mark III
01/19/2022: READY FOR ANYTHING EOS-R5 C
01/13/2022: Community Update. We will be retiring the legacy profile avatars on 01/20/2022. Click this link to read more.
01/05/2022: Welcome to CES 2022!
12/7/2021: New firmware version 1.3.0 is available for Mount Adapter EF-EOS R 0.71x
12/7/2021: New firmware version 1.1.1 is available for CR-N 300
12/7/2021: New firmware version 1.1.1 is available for CR-N 500
12/2/2021: New firmware version 1.1.0 is available for RF 70-200 F4 L IS USM