We ended up applying camera-specific tone curves that match the embedded thumbnail after LibRaw has finished processing it. It seems to work pretty well. We took inspiration for that from how darktable does it. (darktable is open source so you can check the code if you're interested.) I'm guessing the variable contrast mode in FastRawViewer is doing something similar.
Hey, I would also be interested in this topic of how to prepare a "good" visual representation of a RAW file automatically (similar to what FastRawViewer, RawTherapee, etc are doing). Using only dcraw_process() is not enough. I know in the documentation it also says that you should probably write your own algorithm. Is there any literature or open source examples of a "good enough" implementation that produces better results? Especially the exposure seems to be missing in the processing. Take a look at this example, where the top row are original RAW files as seen through FastRawViewer and the bottom row are the images created with dcraw_process(). You can hardly see the difference between the three exposures.
LibRaw is NOT a complete EXIF/Makernotes parser. We're focused on data that needed for RAW processing, other fields are optional. Please use some other software for complete metadata parsing and interpretation
1)Not sure what is displayed by exiftool, it may be offset from file beginning, not from jpeg preview start.
(hard to tell without having the file)
2) tags larger than 4 bytes contains offset (relative to IFD start), not exact value, so one need to seek to this offset to read the data. There is not enough output in your quote to check this.
BTW, I suggest you to not invent the wheel :), but use some exif parser (e.g. exiv2 if you can tolerate GPL licensing)
Could you please point out how you made it work with VS?
I have also compiled Libraw with enabled LCMS (by modifying Makefile.msvc file) and the generated executables work just fine supporting LCMS. However, not when I link Libraw to my VS. It still seems like it doesn't support LCMS. any advice?
According to your code, you use 'all defaults' for libraw processing (dcraw_process), so daylight white balance and automatic 1%-ETTR brightness correction.
There's other huge gamuts too, like xTremeRGB , MaxRGB, and AllColorsRGB. None of these are in libraw, but the description of xtremeRGB says that, "CAUTION: XtremeRGB may cause hallucinations or eye cancer." (http://www.hutchcolor.com/profiles.html)
What demosaic method for X-Trans do you use?
We ended up applying camera-specific tone curves that match the embedded thumbnail after LibRaw has finished processing it. It seems to work pretty well. We took inspiration for that from how darktable does it. (darktable is open source so you can check the code if you're interested.) I'm guessing the variable contrast mode in FastRawViewer is doing something similar.
Good luck!
Hey, I would also be interested in this topic of how to prepare a "good" visual representation of a RAW file automatically (similar to what FastRawViewer, RawTherapee, etc are doing). Using only dcraw_process() is not enough. I know in the documentation it also says that you should probably write your own algorithm. Is there any literature or open source examples of a "good enough" implementation that produces better results? Especially the exposure seems to be missing in the processing. Take a look at this example, where the top row are original RAW files as seen through FastRawViewer and the bottom row are the images created with dcraw_process(). You can hardly see the difference between the three exposures.
https://www.dropbox.com/s/jvdeu9h0bds9bse/libraw_vs_fastrawviewer.png?dl=0
Sorry, know nothing about Debian.
There is no problem with your file and LibRaw fetched from github (current public snapshot) and compiled with -DUSE_ZLIB (and linked with -lz)
I see. Thanks for the prompt reply!
_rgb_cam (input data) is similar to DNG CameraMatrixN (https://www.adobe.com/content/dam/acom/en/products/photoshop/pdfs/dng_sp...) so contains both color transform and D65 WB coefficients.
What version of LibRaw do you use?
Hi Alex,
thank you very much. I appreciated your quick reply.
Confirmed, it does the trick.
Thilo
make -f Makefile.dist
should do the trick
LibRaw is not about RAW writing, but about reading.
ok, I get it.
LibRaw is NOT a complete EXIF/Makernotes parser. We're focused on data that needed for RAW processing, other fields are optional. Please use some other software for complete metadata parsing and interpretation
Thanks for your reply and advice.
I've solved the panasonic rw2 issue.
1)Not sure what is displayed by exiftool, it may be offset from file beginning, not from jpeg preview start.
(hard to tell without having the file)
2) tags larger than 4 bytes contains offset (relative to IFD start), not exact value, so one need to seek to this offset to read the data. There is not enough output in your quote to check this.
BTW, I suggest you to not invent the wheel :), but use some exif parser (e.g. exiv2 if you can tolerate GPL licensing)
Hi, sorry to bother you again.
Don't know how the offset works,
Thanks for the tip. I'm trying to parse and get the data from
lr_ptr->imgdata.thumbnail.thumb
I used the exiftool program to see the structure (with -v3 command line key to see details)
It clearly shows this:
| 32) JpgFromRaw (SubDirectory) -->
| - Tag 0x002e (713278 bytes, undef[713278]):
[skip[
--- DOC1:JpgFromRaw --------------------------------------------------------
JPEG APP1 (50684 bytes):
0006: 45 78 69 66 00 00 49 49 2a 00 08 00 00 00 10 00 [Exif..II*.......]
[skip]
ExifByteOrder = II
+ [IFD0 directory with 16 entries]
and 0x004d is within Makernotes pointed by this (JpgFromRaw) EXIF
Great, I didn't know that the 0x004d tag is not in Raw exif but in thumbnail exif. Thanks for the advice.
I do not know what specific camera you're talking about.
Just inspected some GH5S file. For this file 0x004d/AFPointPosition tag is not in IFD0, but in makernotes section of EXIF.
The bad thing: this is NOT RAW/EXIF, but EXIF contained in embedded JPEG preview.
So, to extract the data you need:
- extract thumbnail (preview) using LibRaw::unpack_thumb
- use some EXIF parser to parse thumbnail's EXIF
I've tried to use these code to catch the exif tag data.
0x004d is from https://exiftool.org/TagNames/Panasonic.html named "AFPointPosition".
I can get all the tags printed, but no "0x004d" found.
p.s.
The rw2 raw file i'm using can be extracted a "0x004d" AFPointPosition tag data by the ExifTool downloaded from https://exiftool.org/
in the next public snapshot (this Fall)
You may try to use 'exif callback': https://www.libraw.org/docs/API-CXX.html#exif
Note: for panasonic's main IFD, tag is or-ed with 0x30000 (to distinguish from normal tiff ifd)
Could you please point out how you made it work with VS?
I have also compiled Libraw with enabled LCMS (by modifying Makefile.msvc file) and the generated executables work just fine supporting LCMS. However, not when I link Libraw to my VS. It still seems like it doesn't support LCMS. any advice?
According to your code, you use 'all defaults' for libraw processing (dcraw_process), so daylight white balance and automatic 1%-ETTR brightness correction.
There's other huge gamuts too, like xTremeRGB , MaxRGB, and AllColorsRGB. None of these are in libraw, but the description of xtremeRGB says that, "CAUTION: XtremeRGB may cause hallucinations or eye cancer." (http://www.hutchcolor.com/profiles.html)
Pages