Recent comments

Reply to: Image data does not match   2 weeks 6 days ago

>>> Can you help me with the first RGBG values? What are they for then?

Sorry, could not understand this question.

Reply to: Image data does not match   2 weeks 6 days ago

imgdata.image[] is processing array. After dcraw_process() it contains 16-bit linear data in [0..2] components and some garbabe in [3]

To implement exposure correction one may use params settings as described in library manual

Reply to: Image data does not match   2 weeks 6 days ago

Ahh, thanks.
So, I assume I use the wrong settings.... When I just use the camera WB, I should get the same as PS with camera WB, right?

Can you help me with the first RGBG values? What are they for then?

Regards.

Reply to: Image data does not match   2 weeks 6 days ago

Also I've modified your sample with commenting out params settings section, from

    Proc.imgdata.params.shot_select         = 0;        // Select first RAW, in case there are more

to (including) custom gamma section.

After that, 1st line of output is:

0,0,0,1603,2064,330,1630,1,54,64,14,16383

Same 54,64,14, as expected (if compiled with -std=c++17)

Reply to: Image data does not match   2 weeks 6 days ago

Thank you very much!!!!

So the .image->data[] is the final RGB array, with the selected WB.
But, then I still don't get what imgdata.image[][] is for?

To wich of these fields do I have to apply my exposure compensation "pixel *= 2^EV"?
Or, in other words, wich of these two fileds do I have to apply my processing?

Regards.

Reply to: Image data does not match   2 weeks 6 days ago

Thanks.
I've added this to the mem_image sample:

	printf("PIX0: image: %d/%d/%d  mem_image: %d/%d/%d\n",
	RawProcessor.imgdata.image[0][0],
	RawProcessor.imgdata.image[0][1],
	RawProcessor.imgdata.image[0][2],
	image->data[0],	image->data[1],	image->data[2]);

just after these lines:

    libraw_processed_image_t *image = RawProcessor.dcraw_make_mem_image(&ret);
    if (image)
    {

Output: PIX0: image: 1603/2064/330 mem_image: 54/64/14

The last triple is similar with your Photoshop numbers. So, it looks like your printing code is wrong.

Yellow cast is because Daylight WB is used (unless use_camera_wb is not set)

Reply to: Image data does not match   2 weeks 6 days ago

RAW file, of course. It looks like I need to repeat your experiment with your input data.

Reply to: Image data does not match   2 weeks 6 days ago

Which file do you mean? The Source or resulting images?

And I'm using C++17 in VS2019 Community.

Reply to: Image data does not match   2 weeks 6 days ago

Could you please share the sample file?

Reply to: Image data does not match   2 weeks 6 days ago

I tested both samples now.
They work both, but have the same heavy yellow shift when opend in PS. (It's an old Canon 7D cr2 by the way.) The exported thumbnail had not.

And, even with the heavy yellow shift, the values do not match... In 8 and 16 bit mode....

The first pixel of the ppm file in PS has RGB(54, 64, 14).
The first pixel of my xls has
RGBG2(542,1052,418,874) from .imgdata.image[pos][], or
RGB(22,34,18) from image->data[]

Regards.

Reply to: Image data does not match   2 weeks 6 days ago

Samples are in samples/*.cpp in LibRaw distribution.

Reply to: Image data does not match   2 weeks 6 days ago

BTW, in this piece of code

"," << (int) image->data[rgb_pos++] <<
                "," << (int) image->data[rgb_pos++] <<
                "," << (int) image->data[rgb_pos++] 

Execution order is not specified (before C++17, AFAIK), that may explain garbage output.

Reply to: Image data does not match   2 weeks 6 days ago

Yes, please start from samples. If LibRaw's samples provides expected (visually correct) results that mean that the problem is not within LibRaw.....

Reply to: Image data does not match   2 weeks 6 days ago

Yes, I know, but even in 8 bit mode it did not match. The values seem random to me.

You mean from the samples page? no, not yet. I'll try this and copy this code.

Regards.

Reply to: Image data does not match   2 weeks 6 days ago

And also:
data field in libraw_processed_image_t is 'unsigned char', while you're using 16-bit output.
So you dump 8-bit wise pieces, not real 16-bit values.

Reply to: Image data does not match   2 weeks 6 days ago

Let's start from the beginning.
Have you tried dcraw_emu sample? If so, are results 'expected' or not?
Same question with mem_image sample.....

Reply to: Image data does not match   2 weeks 6 days ago

Thanks for your fast response.

Well, I loaded the image as shown in my code. I know, PS/LR have some hidden adjustments.
The first 100x100 pixel in the image, listed in the xls, are supposed to be some kind of green. Leaves and treetops.

But all data listed is not near the RGB values for green. And furthermore these values are supposed be in a neare range of greens. But all listed data seem to jump all over the place.
I tried both, 8 and 16 bits for the output, and other different modes in the params. But nothing worked for me.

Yes, I know that the rawdata has a larger field then the final RGB values. This is just some kind of "test" to see a reason for that jumping values.

Regards.

Reply to: Dependency for distriubtion   2 weeks 6 days ago

You can always double-check what your libraw.dll links against at runtime using the Dependency Walker: https://www.dependencywalker.com/

Reply to: Postprocessing like raw viewers   2 weeks 6 days ago

dcraw.c's postprocessing (LibRaw::dcraw_process is derived from it) do not have contrast controls.

Reply to: Postprocessing like raw viewers   2 weeks 6 days ago

Thanks for the quick reply, Alex.

The fixed vs variable contrast indeed seems to be the major contributing factor to the difference. I'm not familiar with that terminology; could you explain what variable contrast mode does? Can LibRaw emulate it?

Reply to: Dependency for distriubtion   2 weeks 6 days ago

I think you need to build LibRaw with
-DUSE_JPEG (to handle jpeg-compressed files, like 'fast load DNG' and some old Kodaks)
-DUSE_ZLIB (to handle deflate-compressed floating point DNG files)

These settings will handle "99%" of today RAW files.
So libjpeg and libz to be distributed with libraw(.dll)

Reply to: Postprocessing like raw viewers   2 weeks 6 days ago

LibRaw::dcraw_process output is close (enough) to FastRawViewer in fixed contrast + auto ETTR mode.

Reply to: Image data does not match   3 weeks 3 hours ago

Could you please ask more specific question?

imgdata.image is 16 bit/linear
image->data is 16 bit (output_bps set to 16) and gamma corrected (as far as I could understand from your code)
Both imgdata.image and image.data are cropped (by imgdata.sizes top/left_margin and width/height), while imgdata.rawimage.* is not cropped.
Also, imgrata.rawimage contains unaltered raw values, black level not subtracted

Reply to: Access RGB values from libraw_processed_image_t   3 weeks 1 day ago

I have now released the lib for general use under https://github.com/lanthale/librawfx. Thank you allot for your help with the compilation and accessing the raw RGB data.

Pages