the last word

Photography meets digital computer technology. Photography wins -- most of the time.

  • site home
  • blog home
  • galleries
  • contact
  • underwater
  • the bleeding edge
You are here: Home / The Last Word / Color photography without demosaicing in the real world

Color photography without demosaicing in the real world

April 19, 2014 JimK 4 Comments

Today I continue exploring using a technique to produce half-sized images from sensors with Bayer color filter arrays (CFAs). The technique was described here, and the way I’m implementing it was explained here.

I started with a raw file of this scene, photographed with the Sony a7R and the Sony/Zeiss 55mm f/1.8 Sonnar FE (aka the Zony 55) lens:

2611

I demosaiced the image with bilinear interpolation, and with adaptive homogeneity-directed demosaicing (AHD), then downsampled those images to half size in Photoshop using bicubic sharper. I also produced a half size image with the four-pixels-into-one technique. I enlarged a tight crop of each of the three images by 400% using nearest neighbor.

This is the image demosaiced with bilinear interpolation:

2611 bilinear

This is the image demosaiced with AHD:

2611 AHD

This is the image downsampled using the four-pixels-into-one method:

2611 2x2

The AHD and the bilinear interpolation images are virtually identical. The four-pixels-into-one crop is clearly sharper, but it also suffers from false-color artifacts, which are almost completely absent from the bilinear interpolation and AHD images. The side of the chimney is a good place to see the false-color four-pixels-into-one artifacts (which are red there), but you can also see many false colors in the tree leaves, although it wouldn’t be so obvious that they are artifacts if you didn’t have the other images to compare it with. Notice that the small branches and foliage in the bottom part of the crop are larger in the bilinear interpolation and AHD images, a symptom of lost sharpness.

This is typical of the differences throughout the scene. My conclusion is that the four-pixels-into-one technique is not, in general, worth the trouble. If the objective were a monochrome image, maybe things would be different.

It is also possible that some specialized filtering operation before the four-pixels into one operation would help. However, I have no plans to explore this.

The Last Word

← Color photography without demosaicing in practice Luminance and chromaticity vs spatial frequency →

Comments

  1. Royi says

    April 19, 2014 at 2:34 pm

    Do you know if DCRAW does a naive calculation of the “Super Pixel” or something fancy?
    By Naive I mean only averaging the green and taking the ‘R’ and ‘B’.

    If so, this is not a smart thing to do.
    I think with slightly optimized algorithm the results should be much much better.

    Reply
    • Jim says

      April 19, 2014 at 2:37 pm

      Using your terminology, my understanding is that it does a “naive” calculation. IF you have suggestions for a better way, I’m all ears, especially if you have some Matlab code.;).

      Jim

      Reply
  2. Royi says

    April 20, 2014 at 4:23 pm

    Do you have a MATLAB code which knows how to get data from RAW files?
    Maybe I’ll give it a try.

    By the way, you should have “Enroll for updates” for the comments.
    Otherwise I’ll never know about your response.

    Reply
    • Jim says

      April 20, 2014 at 8:59 pm

      Is this what you mean? Uses DCRAW…

      pathInput = ‘ C:\temp\dcraw\’; %need the space in front for dcraw command
      rawSuffix = ‘.ARW’; % this is for Sony
      dcrawTiffSuffix = ‘.tiff’;
      inFilename = ‘xxx’; %put file name here
      dcrawOptions = ‘dcraw -v -w -P -o2 -h -k 128 -4 -T’; % put your chosen options here
      fullFileName = strcat(pathInput,inFilename,rawSuffix);
      dcrawCommand = strcat(pathDCRAW,dcrawOptions,fullFileName);
      system(dcrawCommand); % result stored as TIFF

      Then just read in the TIFF file.

      Jim

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

February 2023
S M T W T F S
 1234
567891011
12131415161718
19202122232425
262728  
« Jan    

Articles

  • About
    • Patents and papers about color
    • Who am I?
  • Good 35-70 MF lens
  • How to…
    • Backing up photographic images
    • How to change email providers
  • Lens screening testing
    • Equipment and Software
    • Examples
      • Bad and OK 200-600 at 600
      • Excellent 180-400 zoom
      • Fair 14-30mm zoom
      • Good 100-200 mm MF zoom
      • Good 100-400 zoom
      • Good 100mm lens on P1 P45+
      • Good 120mm MF lens
      • Good 18mm FF lens
      • Good 24-105 mm FF lens
      • Good 24-70 FF zoom
      • Good 35 mm FF lens
      • Good 60 mm lens on IQ3-100
      • Good 63 mm MF lens
      • Good 65 mm FF lens
      • Good 85 mm FF lens
      • Good and bad 25mm FF lenses
      • Good zoom at 24 mm
      • Marginal 18mm lens
      • Marginal 35mm FF lens
      • Mildly problematic 55 mm FF lens
      • OK 16-35mm zoom
      • OK 60mm lens on P1 P45+
      • OK Sony 600mm f/4
      • Pretty good 16-35 FF zoom
      • Pretty good 90mm FF lens
      • Problematic 400 mm FF lens
      • Tilted 20 mm f/1.8 FF lens
      • Tilted 30 mm MF lens
      • Tilted 50 mm FF lens
      • Two 15mm FF lenses
    • Found a problem – now what?
    • Goals for this test
    • Minimum target distances
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Printable Siemens Star targets
    • Target size on sensor
      • MFT
      • APS-C
      • Full frame
      • Small medium format
    • Test instructions — postproduction
    • Test instructions — reading the images
    • Test instructions – capture
    • Theory of the test
    • What’s wrong with conventional lens screening?
  • Previsualization heresy
  • Privacy Policy
  • Recommended photographic web sites
  • Using in-camera histograms for ETTR
    • Acknowledgments
    • Why ETTR?
    • Normal in-camera histograms
    • Image processing for in-camera histograms
    • Making the in-camera histogram closely represent the raw histogram
    • Shortcuts to UniWB
    • Preparing for monitor-based UniWB
    • A one-step UniWB procedure
    • The math behind the one-step method
    • Iteration using Newton’s Method

Category List

Recent Comments

  • Brian Olson on Fuji GFX 100S exposure strategy, M and A modes
  • JimK on Picking a macro lens
  • JimK on Picking a macro lens
  • Glenn Whorrall on Picking a macro lens
  • JimK on What pitch do you need to scan 6×6 TMax 100?
  • Hatzipavlis Peter on What pitch do you need to scan 6×6 TMax 100?
  • JeyB on Internal focusing 100ish macro lenses
  • JimK on How focus-bracketing systems work
  • Garry George on How focus-bracketing systems work
  • Rhonald on Format size and image quality

Archives

Copyright © 2023 · Daily Dish Pro On Genesis Framework · WordPress · Log in

Unless otherwise noted, all images copyright Jim Kasson.