I have been using LibRaw to decode RAF files from Fuji mirrorless cameras.
However, I noticed that the bright/highlight areas are somewhat clipped and has a blue color tint when I apply a macOS Core Image highlight filter, trying to recover highlights.
My workflow goes like this:
1. Use LibRaw to unpack the image data
2. Create a Core Image (CIImage) from the image data
3. Use Core Image filters for processing highlights, there is a filter in the Core Image API for just that.
Here is what I do in step 1:
LibRaw *rawProcessor = new LibRaw;
rawProcessor->imgdata.params.user_qual = 0;
rawProcessor->imgdata.params.use_camera_wb = 1;
rawProcessor->imgdata.params.use_auto_wb = 0;
rawProcessor->imgdata.params.no_auto_bright = 1;
rawProcessor->imgdata.params.exp_correc = 1;
rawProcessor->imgdata.params.exp_shift = 1.7;
rawProcessor->imgdata.params.user_flip = 0;
rawProcessor->imgdata.params.use_camera_matrix = 1;
if (rawProcessor->open_file([filePath UTF8String]) == LIBRAW_SUCCESS) {
int ret = rawProcessor->unpack();
if (ret == LIBRAW_SUCCESS) {
ret = rawProcessor->dcraw_process();
if (ret == LIBRAW_SUCCESS) {
libraw_processed_image_t *imageData = rawProcessor->dcraw_make_mem_image(&ret);
}
}
}
imageData is then turned into a Core Image. There is no processing in between.
Am I missing something?
Also, Fuji images will appear darker when the RAF files have Dynamic Range set at 200% or 400%. How do I correct the image brightness when image is exposed with 1-stop or 2-stop less light? Do I just add 1.0 or 2.0 to params.exp_shift to compensate for this?
Recent comments