the red color is pale my question is how am i gonna get the one you shared by calling the libraw c++ api methods because calling dcraw_process() and make_mem_image() even by setting the gamm[0] and gamm[1] does not give me true colors i think in the demosaicing and color rendering i have to do something to get to these colors: https://www.dropbox.com/scl/fi/tens8j8oks2ozwchh1otp/Screenshot-2025-11-...
if you check these two links they have different shade of red , the thing is this happens for the raf images that have
rawProcessor.imgdata.color.cam_xyz
this parameter as null or empty.
decode(const std::string &path) {
LibRaw rawProcessor;
int ret = rawProcessor.open_file(path.c_str());
if (ret != LIBRAW_SUCCESS) {
throw FileLoadException("Cannot open RAW file: " + path);
}
// --- Processing parameters ---
rawProcessor.imgdata.params.use_auto_wb = 0;
rawProcessor.imgdata.params.use_camera_wb = 1;
rawProcessor.imgdata.params.use_camera_matrix = 3;
rawProcessor.imgdata.params.output_bps = 16;
rawProcessor.imgdata.params.exp_correc = 0;
rawProcessor.imgdata.params.med_passes = 1;
rawProcessor.imgdata.params.fbdd_noiserd = 1;
rawProcessor.imgdata.params.four_color_rgb = 1;
rawProcessor.imgdata.params.user_qual = 4;
rawProcessor.imgdata.params.use_fuji_rotate = 1;
rawProcessor.imgdata.params.dcb_iterations = 1;
rawProcessor.imgdata.params.dcb_enhance_fl = 1;
rawProcessor.imgdata.params.no_interpolation = 0;
rawProcessor.imgdata.params.output_color = 1;
rawProcessor.imgdata.params.no_auto_bright = 1;
ret = rawProcessor.unpack();
if (ret != LIBRAW_SUCCESS) {
throw Exception("Failed to unpack RAW file: " + path);
}
// --- Process the RAW data ---
ret = rawProcessor.dcraw_process();
if (ret != LIBRAW_SUCCESS) {
throw EXCEPTION();
}
libraw_processed_image_t *procImage = rawProcessor.dcraw_make_mem_image(&ret);
if (!procImage || !procImage->data) {
if (procImage) LibRaw::dcraw_clear_mem(procImage);
rawProcessor.recycle();
throw Exception("Failed to get processed image memory");
}
//return processed image data
}
the above code is how i get the attached look and color i think somehow in the demosaicing part the colors do not render as they should! and that's when the "rawProcessor.imgdata.color.cam_xyz" is empty or all zeros what i understood is even if i populate that base on the colordata.c info nothing changes for the end result. what am i missing to get to the look and color you shared in the link? thanks.
Yes the problem is you see when i shared my photo
this one: https://www.dropbox.com/scl/fi/ieqfn6st54d0f2iul7s2k/wrong-color.png?rlk...
the red color is pale my question is how am i gonna get the one you shared by calling the libraw c++ api methods because calling dcraw_process() and make_mem_image() even by setting the gamm[0] and gamm[1] does not give me true colors i think in the demosaicing and color rendering i have to do something to get to these colors:
https://www.dropbox.com/scl/fi/tens8j8oks2ozwchh1otp/Screenshot-2025-11-...
if you check these two links they have different shade of red , the thing is this happens for the raf images that have
this parameter as null or empty.
decode(const std::string &path) { LibRaw rawProcessor; int ret = rawProcessor.open_file(path.c_str()); if (ret != LIBRAW_SUCCESS) { throw FileLoadException("Cannot open RAW file: " + path); } // --- Processing parameters --- rawProcessor.imgdata.params.use_auto_wb = 0; rawProcessor.imgdata.params.use_camera_wb = 1; rawProcessor.imgdata.params.use_camera_matrix = 3; rawProcessor.imgdata.params.output_bps = 16; rawProcessor.imgdata.params.exp_correc = 0; rawProcessor.imgdata.params.med_passes = 1; rawProcessor.imgdata.params.fbdd_noiserd = 1; rawProcessor.imgdata.params.four_color_rgb = 1; rawProcessor.imgdata.params.user_qual = 4; rawProcessor.imgdata.params.use_fuji_rotate = 1; rawProcessor.imgdata.params.dcb_iterations = 1; rawProcessor.imgdata.params.dcb_enhance_fl = 1; rawProcessor.imgdata.params.no_interpolation = 0; rawProcessor.imgdata.params.output_color = 1; rawProcessor.imgdata.params.no_auto_bright = 1; ret = rawProcessor.unpack(); if (ret != LIBRAW_SUCCESS) { throw Exception("Failed to unpack RAW file: " + path); } // --- Process the RAW data --- ret = rawProcessor.dcraw_process(); if (ret != LIBRAW_SUCCESS) { throw EXCEPTION(); } libraw_processed_image_t *procImage = rawProcessor.dcraw_make_mem_image(&ret); if (!procImage || !procImage->data) { if (procImage) LibRaw::dcraw_clear_mem(procImage); rawProcessor.recycle(); throw Exception("Failed to get processed image memory"); } //return processed image data }the above code is how i get the attached look and color i think somehow in the demosaicing part the colors do not render as they should! and that's when the "rawProcessor.imgdata.color.cam_xyz" is empty or all zeros what i understood is even if i populate that base on the colordata.c info nothing changes for the end result. what am i missing to get to the look and color you shared in the link? thanks.