Recent comments

Reply to: CMYK Raw Image Data   1 month 1 week ago

The file sample you provide *mostly* contains 0xFF bytes (not all bytes are 0xff, but ~62% from beginning is).

It is not easy to analyze such samples, do you have another one (with some image with well-known object with known non-neutral colors).

Generally, CustomCamera may work for FRV, but we need known colors to guess CFA.

Reply to: LibRaw 0.19.2-Release   1 month 2 weeks ago

I've now checked also images from the 800D and 77D models:
DNG-Converter converts to 6024x4022, and DCRAW reports 6024x4020.

And I found that with both models the additional top rows of the DNGs are black!
So the correct size seems to be 6024x4020.
Since there is no chance to have a common and correct size, I think it might be the best to not change anything.

Reply to: LibRaw 0.19.2-Release   1 month 2 weeks ago

Thank you for your feedback and attention to details. Case closed.

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

I'm afraid it's more basic than magic.

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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...

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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-...

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

The second one (_03.nef) is underexposed: https://www.dropbox.com/s/2jmz4niipiv552v/Screenshot%202019-01-25%2017.4...
(gray square on girl's cheek is RawDigger sample, average green/red is ~5EV below saturation point).

After exposure correction the image is more-or-less OK: https://www.dropbox.com/s/g76re8v887rnfen/Screenshot%202019-01-25%2017.4...

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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

Reply to: guidance needed to improve image quality   1 month 3 weeks ago

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

Reply to: Request for software names   1 month 3 weeks ago

Fotoxx is a photo editor and collection manager for Linux.
Usage: Load RAW files using libraw, edit using Fotoxx (with full bit depth), save as jpeg/png/tiff (8/16 bit color).
Fotoxx home: https://kornelix.net

Reply to: Missing option (cfaline)   1 month 3 weeks ago

Thanks.

Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 3 weeks ago

LibRaw 0.19.2 + provided ./configure works fine too (thumbnail extraction works even for not supported cameras in most cases).
We're not responsible if one
- use unknown version of autotools
- modifies ./configure results.

Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 3 weeks ago

Using your make procedure works!

But the document on this site says run ./configure, and since there is no configure file, I run mkdist.sh and it does create one.

Could you please update the build procedure?

Many thanks.

Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 3 weeks ago

And system info:

$ uname -a
Darwin OSX10-10.local 17.7.0 Darwin Kernel Version 17.7.0: Wed Oct 10 23:06:14 PDT 2018; root:xnu-4570.71.13~1/RELEASE_X86_64 x86_64
 
$ gcc  -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 3 weeks ago

It just works as expected:

$ git clone https://github.com/LibRaw/LibRaw.git LibRaw-github
$ cd LibRaw-github
 
# edited simple_dcraw to get format printed:
$ git diff
diff --git a/samples/simple_dcraw.cpp b/samples/simple_dcraw.cpp
index 47c329a..78f14f0 100644
--- a/samples/simple_dcraw.cpp
+++ b/samples/simple_dcraw.cpp
@@ -145,7 +145,7 @@ int main(int ac, char *av[])
                  T.tformat == LIBRAW_THUMBNAIL_JPEG ? "thumb.jpg" : "thumb.ppm");
 
         if (verbose)
-          printf("Writing thumbnail file %s\n", thumbfn);
+          printf("Writing thumbnail file %s format: %d\n", thumbfn, T.tformat);
         if (LIBRAW_SUCCESS != (ret = RawProcessor.dcraw_thumb_writer(thumbfn)))
         {
           fprintf(stderr, "Cannot write %s: %s\n", thumbfn, libraw_strerror(ret));
 
# no autotools here, so just:
$ make -f Makefile.dist
 
# identify files:
$ ./bin/raw-identify ~/smpl/*
/Users/lexa/smpl/UNCOMPRESSED_14bit.ARW is a Sony ILCE-7M3 image.
/Users/lexa/smpl/_DSC0010.ARW is a Sony ILCE-7M3 image.
/Users/lexa/smpl/fuji_xh1_compressed.RAF is a Fujifilm X-H1 image.
/Users/lexa/smpl/fuji_xh1_uncompressed.RAF is a Fujifilm X-H1 image.
 
# run simple_dcraw -e -v:
$ ./bin/simple_dcraw -v -e ~/smpl/*
Processing file /Users/lexa/smpl/UNCOMPRESSED_14bit.ARW
Writing thumbnail file /Users/lexa/smpl/UNCOMPRESSED_14bit.ARW.thumb.jpg format: 1
Processing file /Users/lexa/smpl/_DSC0010.ARW
Writing thumbnail file /Users/lexa/smpl/_DSC0010.ARW.thumb.jpg format: 1
Processing file /Users/lexa/smpl/fuji_xh1_compressed.RAF
Writing thumbnail file /Users/lexa/smpl/fuji_xh1_compressed.RAF.thumb.jpg format: 1
Processing file /Users/lexa/smpl/fuji_xh1_uncompressed.RAF
Writing thumbnail file /Users/lexa/smpl/fuji_xh1_uncompressed.RAF.thumb.jpg format: 1
Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 3 weeks ago

Just tried that, simple_dcraw returns 0 for Sony A73 ARW file...

Could you check it under macOS yourself?

Edit: simple_dcraw -L does return Sony A7 III as support camera

Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 4 weeks ago

Could you please apply the patch shown above (print T.tformat in simple_dcraw -e) and check is tformat is really not 1.
Just change the line:
printf("Writing thumbnail file......
to
printf("Writing thumbnail file %s with format: %d\n", thumbfn,T.tformat);

Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 4 weeks ago

I'm running macOS 10.13.6.

I pulled the master branch, and "git branch" returned "* master". ./version.sh returned 0.19.0-Beta1

I ran ./mkdist.sh (since there is no configure file). I could see that mkdist.sh called wget and wiped out dcraw.c in the dcraw directory with an older version.

After that, I just ran "./configure". I removed -DUSE_JASPER and added -DUSER_ZLIB.

I then performed "make" and "sudo make install".

The .h files are up-to-date. And I'm still seeing LIBRAW_THUMBNAIL_UNKNOWN

No idea why at this point.

Reply to: I still get LIBRAW_THUMBNAIL_UNKNOWN from master branch   1 month 4 weeks ago

Dear Sir:
We tried to reproduce the problem:
- fetched LibRaw/master from github to make sure
- compiled it with MSVC 2013.
- selected some sample files (Sony A7-3, Fuji X-H1):

raw-identify.exe fuji_xh1_compressed.RAF fuji_xh1_uncompressed.RAF _DSC0010.ARW UNCOMPRESSED_14bit.ARW:

fuji_xh1_compressed.RAF is a Fujifilm X-H1 image.
fuji_xh1_uncompressed.RAF is a Fujifilm X-H1 image.
_DSC0010.ARW is a Sony ILCE-7M3 image.
UNCOMPRESSED_14bit.ARW is a Sony ILCE-7M3 image.

Than I've modified simple_dcraw.cpp sample to print (numerical) format ID:

diff --git a/samples/simple_dcraw.cpp b/samples/simple_dcraw.cpp
index 47c329a..b079a9f 100644
--- a/samples/simple_dcraw.cpp
+++ b/samples/simple_dcraw.cpp
@@ -145,7 +145,7 @@ int main(int ac, char *av[])
T.tformat == LIBRAW_THUMBNAIL_JPEG ? "thumb.jpg" : "thumb.ppm");

if (verbose)
- printf("Writing thumbnail file %s\n", thumbfn);
+ printf("Writing thumbnail file %s with format: %d\n", thumbfn,T.tformat);
if (LIBRAW_SUCCESS != (ret = RawProcessor.dcraw_thumb_writer(thumbfn)))
{
fprintf(stderr, "Cannot write %s: %s\n", thumbfn, libraw_strerror(ret));

And here is the results:
simple_dcraw.exe -v -e _DSC0010.ARW fuji_xh1_compressed.RAF fuji_xh1_uncompressed.RAF UNCOMPRESSED_14bit.ARW:
Processing file _DSC0010.ARW
Writing thumbnail file _DSC0010.ARW.thumb.jpg with format: 1
Processing file fuji_xh1_compressed.RAF
Writing thumbnail file fuji_xh1_compressed.RAF.thumb.jpg with format: 1
Processing file fuji_xh1_uncompressed.RAF
Writing thumbnail file fuji_xh1_uncompressed.RAF.thumb.jpg with format: 1
Processing file UNCOMPRESSED_14bit.ARW
Writing thumbnail file UNCOMPRESSED_14bit.ARW.thumb.jpg with format: 1

From libraw_const.h:

enum LibRaw_thumbnail_formats
{
LIBRAW_THUMBNAIL_UNKNOWN = 0,
LIBRAW_THUMBNAIL_JPEG = 1,

So, all thumbnails format reported is LIBRAW_THUMBNAIL_JPEG

Please make sure you compile the library and your app with same libraw.h

Reply to: Pink/purple color cast on Sony A7III ARW file?   2 months 8 min ago

I just compiled the master branch, there is no pink/purple cast on that ARW file.

I guess something must be different in handling ARW files between these two branches?

Edit:
If the ARW file is decoded in full resolution, the pink/purple cast is still there. It is only when decoded in half size combined with the master branch, then the image looks fine.

Reply to: Pink/purple color cast on Sony A7III ARW file?   2 months 7 hours ago

Could not reproduce with dcraw_emu.exe -h -T -w -aexpo 2.3 0 -W

Will try to reproduce on Mac, although it should not be platform specific

Reply to: Pink/purple color cast on Sony A7III ARW file?   2 months 7 hours ago

Below is the code I used for processing that Sory A73 ARW file with the pink/purple cast.
Am I doing something wrong?

        LibRaw *rawProcessor = new LibRaw;
        CIImage *ciImage = nil;
        // Set up image processing parameters
        rawProcessor->imgdata.params.half_size = 1;
        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 = 2.3;
        rawProcessor->imgdata.params.use_rawspeed = 0;
        rawProcessor->imgdata.params.user_flip = 0;     // Do not rotate image, let the caller do it
 
        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);
                    rawProcessor->recycle();
 
                    // make data provider from buffer
                    CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, imageData->data, imageData->data_size, NULL);
 
                    // set up for CGImage creation
                    int bitsPerComponent = imageData->bits;
                    int bitsPerPixel = imageData->bits * imageData->colors;
                    int bytesPerRow  = bitsPerPixel / 8 * imageData->width;
                    int width = imageData->width;
                    int height = imageData->height;
 
                    CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
                    CGImageRef imageRef = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, kCGBitmapByteOrderDefault, provider, NULL, NO, kCGRenderingIntentDefault);
                    ciImage = [CIImage imageWithCGImage:imageRef];
                    // Free memory
                    CFRelease(colorSpaceRef);
                    CFRelease(imageRef);
                    CFRelease(provider);
                    LibRaw::dcraw_clear_mem(imageData);
                    // Auto adjust image
                    NSDictionary *options = @{ CIDetectorImageOrientation : [NSNumber numberWithInt:1],
                                               kCIImageAutoAdjustRedEye : [NSNumber numberWithBool:NO]};
                    NSArray *adjustments = [ciImage autoAdjustmentFiltersWithOptions:options];
                    for (CIFilter *filter in adjustments) {
                        // Do not apply tone curve, as it can make the contrast too high
                        if ([[filter name] isNotEqualTo:@"CIToneCurve"]) {
                            [filter setValue:ciImage forKey:kCIInputImageKey];
                            ciImage = filter.outputImage;
                        }
                    }
                }
            }
        }
        delete rawProcessor;
        return ciImage;

Pages