I have now found the issue which parameter is causing the problem. If one of those parameters below are set the colors are washed out. In 0.20.2 this is not happening.
I try's the sample applications and you are right that all is working.
The problem is that the sample applications are not setting any params. As soon as you add my param list the output colors are also washed out.
I am using the following params to speed up decoding of x-trans files (For Canon/Nikon it doesn't matter). Without those parameters the encoding is much slower. But if I set only one parameter the color are washed out independently which parameter I set:
use_camera_wb$set(params$slice, 0);
use_auto_wb$set(params$slice, 0);
output_tiff$set(params$slice, 0);
half_size$set(params$slice, 0);
user_qual$set(params$slice, 0);
Please try to reproduce the problem using LibRaw's sample application (dcraw_emu or simple_dcraw). If these applications produces correct results, the problem source is probably in your code or in Java wrapper you use.
Brightness adjustement and maximum level adjustement are different things (wrong maximum may/will result into 'pink highlights' problem and auto-adjust works against it).
I agree, set_maximum_adj_threshold should be added to C-API.
with dcraw_emu using -M -o 0 -c 0 -j -W -q 1 -4 -T as arguments, both TIFF images converted from CR3 now look equally bright, and the two TIFF images converted from the corresponding DNG files also look equally bright. However, the TIFF images converted from CR3 and DNG differ in brightness. Is this by design?
I'm now trying to figure out how to use it programmatically. The parameter adjust_maximum_thr seems not to be accessible from the libraw_set_... API. I'm using C# with InteropServices. I think I can write such method and amend it to libraw; or better maybe you should consider the addition of this method (something like libraw_set_maximum_threshold).
I can provide the files (as long as they will not appear in a public forum). I think it would suffice to upload the two .CR3 files (35 MB each). Can you please show me a way to upload them?
There is libraw_open_wfile() that expects wchar_t filename.
LibRaw/github switched from iostreams-based LibRaw_abstract_datastream implementation to native-calls based implementation (LibRaw_bigfile_buffered_datastream) which is much faster under Win32.
Probably, your msys2's std::filebuf worked right with UTF-8 filenames, but this is miracle, not the expected behaviour.
I do not see color change due to user_qual=0 (output_tiff=0, half_size=0 are the default value).
BTW, you set output_color=0 too. This turns off camera color to sRGB (or other known colorspace) conversion and will result in washed colors.
I have now found the issue which parameter is causing the problem. If one of those parameters below are set the colors are washed out. In 0.20.2 this is not happening.
libraw_output_params_t.output_tiff$set(params$slice, 0);
libraw_output_params_t.half_size$set(params$slice, 0);
libraw_output_params_t.user_qual$set(params$slice, 0);
I try's the sample applications and you are right that all is working.
The problem is that the sample applications are not setting any params. As soon as you add my param list the output colors are also washed out.
I am using the following params to speed up decoding of x-trans files (For Canon/Nikon it doesn't matter). Without those parameters the encoding is much slower. But if I set only one parameter the color are washed out independently which parameter I set:
use_camera_wb$set(params$slice, 0);
use_auto_wb$set(params$slice, 0);
output_tiff$set(params$slice, 0);
half_size$set(params$slice, 0);
user_qual$set(params$slice, 0);
Tested with dcraw_emu -T -w, for both 0.20-stable branch (from github) and for master branch (also from github).
I do not see great color difference here: https://www.dropbox.com/s/vdlbhfyd6e53pu0/Screenshot%202022-01-11%2021.4...
Files produced are also (temp.) stored on dropbox for your inspection: https://www.dropbox.com/sh/ek4rezjhju4xmmx/AACVcj-2X4G1EvI6cpkbpA3xa?dl=0
Please try to reproduce the problem using LibRaw's sample application (dcraw_emu or simple_dcraw). If these applications produces correct results, the problem source is probably in your code or in Java wrapper you use.
EOS R5 (released in 2020) and R3 (released in 2021) are different cameras.
R3 will be supported in the next public version (snapshot or beta/release, whatever come first)
Hi, i have same problem from cannon R3 cr3 (decoded with a purple tint) , that confuse me if R5 is supported
This patch: https://github.com/LibRaw/LibRaw/commit/b31fa58eea272c4ba67ccdbd527f329a...
Exposes adjust_maximum_thr to the C-API
Brightness adjustement and maximum level adjustement are different things (wrong maximum may/will result into 'pink highlights' problem and auto-adjust works against it).
I agree, set_maximum_adj_threshold should be added to C-API.
Hi Alex,
with dcraw_emu using -M -o 0 -c 0 -j -W -q 1 -4 -T as arguments, both TIFF images converted from CR3 now look equally bright, and the two TIFF images converted from the corresponding DNG files also look equally bright. However, the TIFF images converted from CR3 and DNG differ in brightness. Is this by design?
I'm now trying to figure out how to use it programmatically. The parameter adjust_maximum_thr seems not to be accessible from the libraw_set_... API. I'm using C# with InteropServices. I think I can write such method and amend it to libraw; or better maybe you should consider the addition of this method (something like libraw_set_maximum_threshold).
I already used in my program:
```
libraw_set_no_auto_bright(handler, 1);
libraw_set_bright(handler, 1.0f);
```
so I expected no automatic brightness adjustment anyway.
Thanks, LelliD
(copied from E-mail, probably this answer may be interested to public)
To turn off automated maximum adjustement use dcraw_emu -c 0 (imgdata.params.adjust_maximum_thr = 0)
We never publish files that are sent to us without explicit permission.
Please use any file sharing service (e.g. WeTransfer/free option) and send the link to info@libraw.org
Hi,
I can provide the files (as long as they will not appear in a public forum). I think it would suffice to upload the two .CR3 files (35 MB each). Can you please show me a way to upload them?
Lellid
We do not provide precompiled snapshot versions. Please contact vendor of your software to re-compile it with newer libraw.
Looks like your patch works like a charm.
Cheers,
Yes (if you do not use earlier github snapshots)
No problem: no risk no fun ;).
I will let you know.
Last question. Which version I could consider for your change?
LIBRAW_VERSION > LIBRAW_MAKE_VERSION(0, 21, 0)
?As a result, you use very untested (and not supported) code path :)
I will test it.
In fact our code is cross-compiled with CI pipelines: can't use visual studio. Especially because we build it for linux too.
Followup:
I do not have msys2/mingw/similar tools installed, so not tested.
MS Visual Studio (community) is free, so it makes sense to use native vendor compiler for Win32
(should be) fixed by this commit: https://github.com/LibRaw/LibRaw/commit/30595a731f3bea78f0410426b73ef3af...
Oh thank you.
If you fix it, you'll make me happy.
Thanks for your feedback
Please, let me know.
Cheers,
OK, this need to be fixed.
OK thanks for your kindness.
But with libraw_open_wfile
I get:
undefined reference to `libraw_open_wfile'
because in the LibRaw code there is
So it can't work under msys2.
You may switch back via defining LIBRAW_USE_DEPRECATED_IOSTREAMS_DATASTREAM
But this is temp. solution: it will work with LibRaw 0.21, but will be removed in future releases.
Also: LIBRAW_WIN32_UNICODEPATHS is set if:
# elif _GLIBCXX_HAVE__WFOPEN && _GLIBCXX_USE_WCHAR_T
So if such macros are defined for your runtime, unicode paths should work.
There is libraw_open_wfile() that expects wchar_t filename.
LibRaw/github switched from iostreams-based LibRaw_abstract_datastream implementation to native-calls based implementation (LibRaw_bigfile_buffered_datastream) which is much faster under Win32.
Probably, your msys2's std::filebuf worked right with UTF-8 filenames, but this is miracle, not the expected behaviour.
Pages