guidance needed to improve image quality

I implemented the simple generic decode using the dcraw model. I see that the resulting image quality is sometimes fine, sometimes problematic (brightness and color conversion incorrect). What am I missing? Am I expected to understand each camera's characteristics and add post-processing to correct the image?

Outline of implementation:

librawdata->params.use_camera_wb = 1;
librawdata->params.output_color = 1;
err = libraw_dcraw_process(librawdata);
RAWimage = libraw_dcraw_make_mem_image(librawdata,&err);

Forums: 

Could you please provide some

Could you please provide some (properly exposed) samples with 'problematic' color/brightness?

-- Alex Tutubalin @LibRaw LLC

requested images

Thanks for your help.

Here are some raw images and their corresponding jpeg images.
These are all from https://www.photographyblog.com/previews/nikon_d850_photos
(most of the photos on this web page have the same issue).

In my small collection of RAWs from various cameras, some of them are fine after libraw conversion, some have brightness and color problems (i.e. dark and/or faded). The Nikon D850 is one of the problem cases.

The following produces images almost identical to the JPEGs:
$ rawtherapee-cli -d -t -b8 -Y -c

https://www.photographyblog.com/previews/nikon_d850_photos

Nikon D850 RAW images
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_01.nef
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_03.nef
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_09.nef
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_42.nef

Corresponding JPEG images from the camera
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_01.jpg
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_03.jpg
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_09.jpg
https://img.photographyblog.com/reviews/nikon_d850/photos/nikon_d850_42.jpg

Checked the 1st one:

Checked the 1st one:

dcraw -w -T (and irfanview screenshot of resulting tiff file): https://www.dropbox.com/s/ynkb94latus6n55/Screenshot%202019-01-25%2017.0...

Embedded JPEG viewed via FastRawViewer: https://www.dropbox.com/s/wbc4ifjizd9dzm4/Screenshot%202019-01-25%2017.0...

This is screnshots from screen, so in (my) display colorspace (near-sRGB)

I do not see any big problems here, although LibRaw's color profile may differ from Nikon's one

-- Alex Tutubalin @LibRaw LLC

Yes the 1st one is not bad,

Yes the 1st one is not bad, only a small loss in color.
Please check the 2nd one.

Are you saying that 03.nef is

Are you saying that 03.nef is underexposed and the dcraw rendering is normal?
Then the question remains, how did rawtherapee know how to compensate?

Here is a Sony A7 raw, the corresponding 'out of the camera' jpeg, and renderings by dcraw and rawtherapee:
https://kornelix.net/downloads/DSC00574.ARW
https://kornelix.net/downloads/out-of-the-camera.jpg
https://kornelix.net/downloads/dcraw.tif
https://kornelix.net/downloads/rawtherapee.tif

The rawtherapee rendering and the 'out of the camera' jpeg are nearly identical, whereas the dcraw rendering is too dark. Is this normal and expected? (my libraw implementation gives the same result as dcraw).

commands:
dcraw -w -T DSC00574.ARW
rawtherapee-cli -t -b8 -d -c DSC00574.ARW

Source web page for the above raw and jpeg:
https://www.dpreview.com/sample-galleries/6769434587/sony-a7-iii-sample-...

Typical today raw converter

Typical today raw converter (e.g. Adobe's and/or in-camera JPEG generator, I'm not familiar with rawtherapee) applies S-shaped curve (with different parameters for different cameras/different ISO setting on same camera/different other setting e.g. DLO on Nikon cameras).
LibRaw/dcraw default rendering does histogram shift to the right only.

Here is your sample with +1 correction with highlights compression: https://www.dropbox.com/s/fsimdf5alou55qy/Screenshot%202019-01-25%2020.2...

-- Alex Tutubalin @LibRaw LLC

Thanks. That's what I needed

Thanks. That's what I needed to know. I feared there was some magic I was missing.