Raw histogram (at least) for picture viewer

Started by Marsu42, September 15, 2013, 01:19:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marsu42

I couldn't find a request for this, so here it goes (again?):

It would be really helpful to have a raw histogram not only for the last shot taken, but added as an option to the ml picture viewer or to the Canon picture player. It doesn't have to be fancy at all, actually *any* hint, even a text message, if there were blown highlights in the cr2 would be really helpful to decide if to re-take a shot or not.

a1ex

The question is... how do you load the raw data from a CR2?

Marsu42

Quote from: a1ex on September 15, 2013, 01:26:19 PM
The question is... how do you load the raw data from a CR2?

You're the C wiz :-p ... but maybe it's possible to put part of dcraw into a module, just enough to get the max. rgb levels? Or is this completely out of the question due to memory/cpu constraints?

a1ex

It's probably possible, but I'm not curious to try it ;)

(it's hard and I guess it will be very slow, since it will have to decompress the CR2)

chris_overseas

Quote from: a1ex on September 15, 2013, 02:33:26 PM
It's probably possible, but I'm not curious to try it ;)

(it's hard and I guess it will be very slow, since it will have to decompress the CR2)

What about the possibility of writing a sidecar file with the required information when the photo is taken? It wouldn't need to be much, just the bare minimum required to reconstruct the histogram (128 pixels * four channels (RGB + luma) * 6 bits + a small amount of additional metadata). Presumably that sidecar file could be used for other purposes too.
EOS R5 1.1.0 | Canon 16-35mm f4.0L | Tamron SP 24-70mm f/2.8 Di VC USD G2 | Canon 70-200mm f2.8L IS II | Canon 100-400mm f4.5-5.6L II | Canon 800mm f5.6L | Canon 100mm f2.8L macro | Sigma 14mm f/1.8 DG HSM Art | Yongnuo YN600EX-RT II

a1ex

That's easier. What's left to discover is the number of picture selected in playback mode (alternative: name the sidecars using a checksum of the image buffer).

Marsu42

Quote from: chris_overseas on September 15, 2013, 03:03:28 PM
What about the possibility of writing a sidecar file with the required information when the photo is taken?

Excellent idea - I seldom have time to look at the raw histogram right after shooting, and this would solve this. Is it mandatory to analyze each image in play mode just like auto-ettr does for this to work? For the format xmp would be good, it already contains ml deflicker and dual iso data and I guess you can write all sorts of other information into it which is then ignored by the raw converter.

As for reading a cr2 - I don't know about the raw data or the file format, but is it necessary to read *each* pixel from the cr2, maybe downsampling and reading only every nth pixel would be faster and be enough to get a "good enough" information about histogram or clipping?

a1ex

Yes, it's mandatory to have the QR screen to appear (even if it's just for a split second). Intercepting burst in a reliable way is still unsolved.

I had some partial success with hooking in the capture tasks, works on 5D3 for post deflicker, but it's not quite portable (e.g. on 600D post deflicker doesn't work at all) and it's very likely to get out of sync (there was a bug report from 5D2 with noticeable flicker at fast intervals, but OK at slower intervals). Also it's slowing down Canon's capture task. So, I'm going to remove that feature and replace it with a post tool.

For CR2 you need to *decompress* it first.

Marsu42

Quote from: chris_overseas on September 16, 2013, 01:11:54 AM
When shooting wildlife and action it's often not possible to check the exposure carefully before, during, or immediately after shooting - doing so might mean missing "the" shot.

+1 ... I'm constantly trying to explain this point around here, obviously some people haven't got enough photography experience to have been in live wildlife or action situation, and it doesn't make any sense discussing on this basis ... but as long as alex gets the point it's good enough for me :-)

Quote from: chris_overseas on September 16, 2013, 01:11:54 AMHaving the RAW histogram available at that point would be invaluable to me. Currently I often find myself keeping two similar photos with slightly different exposures because I can't be sure if I've blown highlights or not.

Another +1 - even Canon has a histogram for shots taken previously, haven't they? Adding the full raw range to this would be a very big achievement for ml and a decisive point to use it even for non-nerd average canon users who don't fancy complicated exposure modules - the picture style tricks have been known for a long time, but why not go for the real thing?

Last not least, saving the histogram data and then restoring it as far as I understand it isn't much of a problem, so it'd be absolutely terrific if it'd really happen.

gotar

Quote from: a1ex on September 15, 2013, 08:27:11 PM
For CR2 you need to *decompress* it first.

How about histogram from preview data (IFD2 I suppose)? It is uncompressed but small, so fast to read - much less accurate for sure, but it's subsampled from raw data without any WB impact AFAIK.

a1ex

You already have it, just press the shortcut key for zebras in playback (see help, it's camera-specific).

Preview data is JPEG.


gotar

Quote from: a1ex on September 16, 2013, 03:34:05 PM
You already have it, just press the shortcut key for zebras in playback (see help, it's camera-specific).

Preview data is JPEG.

I thought this was calculated from visible screen as it changes it's shape on zooming in or out (to 1/4th of the screen when Canon's histograms are visible), and I've read it here lclevy.free.fr/cr2: "The third IFD is containing a small RGB version of the picture NOT compressed (even with compression==6) and one which no white balance correction has been applied." which seemed appropriate for raw histogram. However in some other cr2 spec I've read that this is camera-specific, so I assume you're right.

Audionut

Quote from: g3gg0 on February 02, 2014, 12:36:25 AM
Canon caches the images you have shot until you poweroff the camera or the memory gets full (5-10 images).
As long the images are in cache, you can review it without any problem.

Anyway to dig into the data from the cache?

a1ex

If they would cache say 5 raw buffers, that means over 200MB => better use this for burst.

So I assume they are caching the JPEG previews only.