• site home
  • blog home
  • galleries
  • contact
  • underwater
  • the bleeding edge

the last word

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

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 *

May 2025
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr    

Articles

  • About
    • Patents and papers about color
    • Who am I?
  • How to…
    • Backing up photographic images
    • How to change email providers
    • How to shoot slanted edge images for me
  • 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 35-70 MF 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

  • bob lozano on The 16-Bit Fallacy: Why More Isn’t Always Better in Medium Format Cameras
  • JimK on Goldilocks and the three flashes
  • DC Wedding Photographer on Goldilocks and the three flashes
  • Wedding Photographer in DC on The 16-Bit Fallacy: Why More Isn’t Always Better in Medium Format Cameras
  • JimK on Fujifilm GFX 100S II precision
  • Renjie Zhu on Fujifilm GFX 100S II precision
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • Ivo de Man on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF
  • JimK on Fuji 20-35/4 landscape field curvature at 23mm vs 23/4 GF

Archives

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

Unless otherwise noted, all images copyright Jim Kasson.