Recent comments

Reply to: Issue on some camera   5 years 1 week ago

1) Canon uses different marketing names for the same model, for example:
1500D / 2000D / Rebel T7 / Kiss X90 or 450D / Digital Rebel XSi / Kiss X2

For Canons, both model and normalized_model are set based on camera ID, not string specified in EXIF

2) Yes, if pre-LibRaw 0.20 margins was not even, new code will adjust it to even value. In that case, bayer pattern will become the same for full sensor area and for visible area within margins.

I'm not familiar with FITS, so could not help here.

Reply to: Issue on some camera   5 years 1 week ago

I find the same behavior with 1300D.

Reply to: LibRaw 0.20.2 Release   5 years 2 weeks ago

I appreciate your efforts to support GPR files in LibRaw. I followed the steps but after spending a few hours, was unable to get things working (I'm building on a Mac). I am wondering if you would consider posting a fork of the GPR SDK with the necessary modifications somewhere that people could build (with the correct Adobe 1.4 SDK if possible). Thank you for your consideration.

Reply to: Question about white balancing   5 years 3 weeks ago

Alex,
Does that mean that when I scale the CFA data using say Tungsten multipliers, the result can be treated as though it was taken against a D65 illuminant?

As for "color profiles for specific light source", are they better because these profiles map the camera space data to XYZ and incorporate the chroma adaptation to D65 in them?

I understand these are more conceptual questions, but I am unable to find good resources that answer them.

Regards,
Dinesh

Reply to: Camera names in supported camera array   5 years 3 weeks ago

I've just created a pull request for this.

David

Reply to: LibRaw::open_file() never returns   5 years 4 weeks ago

Thank you for the samples.
Current (github) LibRaw/master rejects these files.

Most likely, the fix is implemented by this commit: https://github.com/LibRaw/LibRaw/commit/cfb66cb2372b373961321cb7ebeae733...
Prior to this fix (i.e. LibRaw 0.20 release), CR3 parse may loop infinite on truncated files.

(we'll release 0.20.1 soon with this fix and couple of other fixes)

Reply to: LibRaw::open_file() never returns   5 years 4 weeks ago

Definitely not 1-2 days, because we have some not fixed (yet) bugs.

Most likely one week or so.

Reply to: LibRaw::open_file() never returns   5 years 4 weeks ago

Thank you. By soon do you mean 1-2 days, or weeks? If the latter I'll pull the latest updates from git.

Thanks again
David

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

Yes, manually changing imgdata.color.maximum after LibRaw::unpack() will effectively disable the scaling.

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago
scale_colors per-channel multipliers are:
scale_mul[geshifilter-c] = (pre_mul[c] /= dmax) * 65535.0 / maximum;

(dmax is max(pre_mul[0...3], pre_mul is WB coeffs). <p> Final scaling is performed in copy_mem_image unless no_auto_bright is set: <ul> <li>histogram is analyzed (from right to left) to get level # where 1% of pixels are saturated <li>output curve will map 0...level# to full output range </ul>[/geshifilter-c]
Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

This is not what I am seeing.

I have two images, one saturated where the max raw value is 14355 and another unsaturated, where the raw max values are (7560,11708,4489). Turning on interpolation (color_option=0), I get max values of (20055,19270,20076) for the saturated and for the unsaturated (8481,11708,5168). If I turn auto-scale one with user_mul[1.99,1.0,1.77,1.0], I get max values of 65535 for the saturated image (fine, its saturated here also). However, for the unsaturated image, the max values are (55594,49872,39231). So, IN FACT, it did not scale the unsaturated image up to 65535. What does the scaling actually do?

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

Without auto-bright/auto-maximum, scaling scales (theoretical) maximum to 2^16-1.

This is somewhat tricky, for example for 14-bit canons maximum assumed 16383-black_value, while in reality data maximum is lower (as low as ~12000 for 5D Mark II at intermediate ISOs), that's why maximum adjustment was introduced (there is no way to determine real maximum value from metadata for these camera(s)).

For most other vendors, maximum is not that tricky.

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

... something to add here.

I tried converting an image that did not saturate anywhere. The maximum values I get in the image are lower that 2^16. So, I am actually not certain that the procedure really does scale to the full range. I'd really like to understand what the scaling does, as it also does not seem to be just the multiplication factors. Something else is going on.

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

Hi Alex,

Ok, thanks for that update. I wouldn't say it is useless though! For one, you don't actually get more precision by multiplying all values by a constant, unless you are talking about interpolation. Two: for scientific images count numbers are actually important. For example, if you have astronomy images with different exposures, it is nice to be able to scale them to the same level, based on exposure count.

As long as I can multiply each image output by its scaling value in my external program, that's ok. What I really need is for output_color=0 to work with scaling off.

Thanks!

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

There is no standard way to avoid full range (0..65535) scaling in LibRaw::scale_colors (not to scale is useless because of limited ushort precision).
Possible workaround:
params.no_auto_scale = 1 to avoid LibRaw::scale_colors() call
implement own scale_colors replacement (use scale_colors() source as a reference) and provide it via callbacks.pre_preinterpolate_cb

(you'll need to subclass LibRaw and implement the callback in the subclass to allow access to internal data fields)

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

Hi Alex,

Well, the only way I got user_mul to be applied was then no_auto_scale=0. I have always had no_auto_bright=1 and adjust_maximum_thr=0.0.

in Libraw::scale_colors() user_mul is copied to pre_mul if it is set. And then, I only see pre_mul used if use_auto_wb or use_camera_wb is set.

What I would need is to use the camera multipliers (i.e. 1.99,1.0,1.77,1.0, as defined by Canon for my camera), but no scaling done to the image.

Thanks

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

BTW, postprocessing in LibRaw is (very) similar to dcraw.c one, so 'dcraw annotated' may help too: https://ninedegreesbelow.com/files/dcraw-c-code-annotated-code.html

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

no_auto_scale is very special use parameter, quote from docs/API-datastruct.html:

Disables pixel values scaling (call to LibRaw::scale_colors()) in LibRaw::dcraw_process().
This is special use value because white balance is performed in scale_colors(), so skipping it will result in non-balanced image.
This setting is targeted to use with no_interpolation, or with own interpolation callback call.

For normal processing you probably need no_auto_bright=1 (and, may be, adjust_maximum_thr=0.0 too)

P.S. www.libraw.org/docs need update w/ actual LibRaw/doc/ contents (forgot to do it on LibRaw 0.20 release)

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

Oh, F'in aces! The interpolation is nice now. The output_color=0 helped!

All I need to know now is the scaling to the images when using user_mul.

Thanks!

-A

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

Hi Alex,

1) Ok, I'll check them out!
2) I found the problem by digging into the code. The values set in user_mul only get applied when no_autoscale is false, i.e. auto_scaling is applied. This is counterintuitive, as setting your own multipliers does not count as auto_scaling, in my opinion. I noticed the pixel values increasing by a lot more than the multipliers I entered though, and it seems to scale the image by a value determined from a sum. Is this ok? Is this consistent from image to image? I.e., if I take a 2x long exposure, will the values scale by a factor of 2 (if gammas=1.0). I will want to combine and do arithmetics with the images and I don't want artificial scales.
3) I see a change when setting output_color=0. That's great. I'll see if it helped with the interpolation.

Thanks again!

Reply to: user_mul and cam_matrix parameters not working   5 years 4 weeks ago

1st: We do not have donation link (yet). One could buy our software (RawDigger or FastRawVewer or bundle)

2nd: does dcraw_emu -r 2 1 3 1 results in different WB? If so, please start with samples/half_mt.c sample (it also uses C-API) with this additional lines below line ~80:

iprc->params.user_mul[0] = 2;
iprc->params.user_mul[2] = 3;
iprc->params.user_mul[1] =
iprc->params.user_mul[3] = 1;

This should result into bluish output.
(Note: you do not need libraw_raw2image if libraw_dcraw_process is used)

3rd: to use 'raw colors' set params.output_color to 0, this will disable camera color matrix use.

Reply to: A question about "dcraw_make_mem_image"   5 years 4 weeks ago

Just a correction. The code snippet I put there was incorrect.

Recasting should be simply

ushort *image = (ushort *) processed->data;

-A

Reply to: Question about white balancing   5 years 4 weeks ago

Yes, (good) color profiles created for specific light source works better than generic (D65 or D50) ones.

Reply to: libraw errors with DNG files processed by Adobe LightRoom   5 years 4 weeks ago

These files are floating-point DNG files compressed with deflate compression.

To decode such files by LibRaw (without DNG SDK) you need to build LibRaw with USE_ZLIB defined and libz linked.

Here is tiff file produced from your sample by dcraw_emu -T (built w/ options mentioned above): https://www.dropbox.com/s/b2tpar7n395ee2j/_1010194-hdr.dng.tiff?dl=0

Pages