Pink/purple color cast on Sony A7III ARW file?

I'm using LibRaw 0.19.2.

I've this pink/purple color cast issue on just one ARW file taken with the Sony A7III. All the other files from the same camera so far looked fine.

But when I open this problematic file with FastRawViewer or other RAW converters, the colors look fine.

So why am I getting this color cast on this one file?

Forums: 

How reliable is the master

Sorry for the silly question: how reliable is the master (development) branch?

Kuro

We publish master branch

We publish master branch twice a year from our internal repository to github. Publushed version is tested in our end-user software (FastRawViewer, RawDigger), so 'decoder part' usually is reliable (and we do not change postprocessing part much for years, because dcraw_process() is only a sample)

-- Alex Tutubalin

And followup: it is hard to

And followup: it is hard to answer some raw-related questions without file samples.

-- Alex Tutubalin

I do not see any problems

I do not see any problems with LibRaw 0.19.2 and this file (tested with dcraw_emu [-w] from 0.19.2/Windows-64 binary)

-- Alex Tutubalin

Below is the code I used for

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;

Kuro

Could not reproduce with

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

-- Alex Tutubalin

I just compiled the master

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.

Kuro