Recent comments

Reply to: Determine raw file-type   9 years 2 months ago

Very helpful, thank you!

Reply to: Determine raw file-type   9 years 2 months ago

There are a several variables/calls that delivers specific information:

1) LibRaw::imgdata.idata.dng_version - 0 for not-DNG, non-zero for DNG files
2) LibRaw::get_decoder_info() call
3) four calls:
int is_fuji_rotated();
int is_sraw();
int is_nikon_sraw();
int is_coolscan_nef();
and protected
virtual int is_phaseone_compressed();
Will return non-zero for some specific cases that might be interesting in processing workflow

Reply to: Bayer layout   9 years 2 months ago

Thank you.

There seem to be quite a few tricks behin all that. So I think I'll stick with using dcraw processing first... ;)

Reply to: Bayer layout   9 years 2 months ago

Yes, in bayer cameras each pixel is monochrome (R, G, or B). Also, in 2x2 bayer pattern (two green pixels, one R and B), two greens are usually on different ADC channels, so it is safer to treat them as separate channels (G and G2) with different black levels.

Reply to: Bayer layout   9 years 2 months ago

Thanks again, and sorry about the false assumption that dcraw_process() was 8 bits...

I noticed the "only one of rgbg is not null for each pixel" thing... Why is that so?
Could it be that my 16MPixels camera would in fact be a camera with 4M realPixels (16M subPixels, each of them being either r, g or b), and not a 16*4M subPixels camera?

Reply to: Bayer layout   9 years 2 months ago

dcraw_process() is 16 bit internally. Processing result is scaled to 8 bit (if asked) on output routines.

raw2image converts from bayer data (flat, 1 value per pixel) to 4-component image[][4]. Only one component of image is non-zero after raw2image. This is NOT demosaiced image, but data prepared for demosaic (this format is back-compatible to old LibRaw versions, that's why raw2image call is provided).

To get color index (index of non-zero element in 4-component pixel) use COLOR(row,col) call.

Reply to: Images processed by libraw are burned/overexposed   9 years 2 months ago

Yes.

To get behaviour very similar to dcraw (including 'pink clouds' problem) set params.adjust_maximum_thr to 0.0f;

To change auto-brigtening use auto_bright_thr or manual brightness adjustment.

Reply to: Images processed by libraw are burned/overexposed   9 years 2 months ago

Do you say that I can somehow manually change the way LibRaw behaves?

Reply to: LibRaw 1.60 in Debian wrong treat PEF from Pentax K-3   9 years 2 months ago

Thanks.

LibRaw 0.17 works fine with these files, so switch to actual release

(I'll not inspect LibRaw 0.16 for this problem, because 0.16 branch will receive only critical security bugfixes).

Reply to: Images processed by libraw are burned/overexposed   9 years 2 months ago

With default settings, LibRaw processing:
1) Adjust data maximum using real maximum in RAW file (use params.adjust_maximum_thr to adjust)
2) Brighten image to put 1% in saturation (parms.auto_bright_thr to adjust, or turn brightening off via params.no_auto_bright)

Darktable uses own raw processing with all things different.

Reply to: LibRaw 1.60 in Debian wrong treat PEF from Pentax K-3   9 years 2 months ago

egor@shutter:~/src/libraw/LibRaw-0.16.2/bin$ ./simple_dcraw -v -4 -T ~/tmp/raw/IMGP3859.PEF
Processing file /home/egor/tmp/raw/IMGP3859.PEF
/home/egor/tmp/raw/IMGP3859.PEF: data corrupted at 160143
Cannot unpack /home/egor/tmp/raw/IMGP3859.PEF: Input/output error
egor@shutter:~/src/libraw/LibRaw-0.16.2/bin$ cd ../../LibRaw-0.17.0/bin/
egor@shutter:~/src/libraw/LibRaw-0.17.0/bin$ ./simple_dcraw -v -4 -T ~/tmp/raw/IMGP3859.PEF
Processing file /home/egor/tmp/raw/IMGP3859.PEF
Writing file /home/egor/tmp/raw/IMGP3859.PEF.tiff
egor@shutter:~/src/libraw/LibRaw-0.17.0/bin$

Reply to: LibRaw 1.60 in Debian wrong treat PEF from Pentax K-3   9 years 2 months ago

Could you please upload sample file somewhere (dropbox, etc) and share the link.

Reply to: Two Paths Leading Nowhere   9 years 2 months ago

If you have two PNG converters, that take a BMP and turn it into PNG form and found that the output from these converters were different, what would you do? Note that PNG is simply using lossless compression on a BMP any differences means someone is at fault!

Why does this change for RAW converters? Aren't RAW converters "suppose" to be "lossless" or are they horrifically lossy programs that have been touted about as needed by people who have a vested interest in keeping the status quo?

OpenRAW makes far more sense. Proprietary formats don't matter so much as holding a knife to Adobe's throat and saying "we're documenting our RAWs now, so update your code for all platforms because you only exist because of our customers." Companies working together for the betterment of the consumer rather than whatever they think they're doing, should be the real goal here.

Reply to: data_maximum > maximum on some files   9 years 2 months ago

Got the file, thanks.

This is very special case:
color.maximum is calculated from metadata for these files, this is just 0xfffc - black_level

And after LibRaw::unpack() real data maximum is within this range.

But on postprocessing stage, PhaseOne data are linearized using other metadata contained in file (complex process in phase_one_flat_field() call).

After that stage, real (linearized) data values may have values above color.maximum

Reply to: data_maximum > maximum on some files   9 years 2 months ago

The best way it to share it somewhere (Dropbox, google) and send me link.
Or just send via E-mail

my personal e-mail is lexa@lexa.ru

Reply to: data_maximum > maximum on some files   9 years 2 months ago

Sure, how to send you the file (46,9 MB)?

Reply to: data_maximum > maximum on some files   9 years 2 months ago

This is possible and normal for some formats. For example, for DNG files color.maximum is read from corresponding tag, that may contain anything.

BTW, could you provide sample file for analysis?

Reply to: Output formats   9 years 2 months ago

LibRaw do not write RAW data in any format. It can store processing results in .ppm or .tiff, that's all.

Consider Adobe DNG SDK, it can read and write DNG files.

Reply to: 0.17 breaks with openmp and big files.   9 years 3 months ago

Could you please specify more details
- environment (OS, etc)
- compiler used
- interpolation mode used

Reply to: LibRaw::COLOR or LibRaw::fcol   9 years 3 months ago

Thank you!

Reply to: LibRaw::COLOR or LibRaw::fcol   9 years 3 months ago

You may use fcol() instead of FC() in COLOR() definition:

    int COLOR(int row, int col) { return libraw_internal_data.internal_output_params.fuji_width? FCF(row,col):fcol(row,col);}

This is not so efficient because fcol() is not inlined, but if you do not use COLOR() for all pixels of image, it will work.

Reply to: LibRaw::COLOR or LibRaw::fcol   9 years 3 months ago

fcol do not take into account Fuji SuperCCD specifics.

Reply to: LibRaw::COLOR or LibRaw::fcol   9 years 3 months ago

What is LibRaw::fcol, can it be used instead?

Reply to: LibRaw::COLOR or LibRaw::fcol   9 years 3 months ago

Fuji X-Trans is so special and requires different processing in most cases, so COLOR() really used only in bayer processing code, but not in X-Trans.

BTW, this need to be fixed and COLOR() should return correct color even for X-Trans files too. I'll reply to this thread again after pushing fix to github repo.

Pages