Author Topic: making color images from CR2 files  (Read 690 times)

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
making color images from CR2 files
« on: 2019 June 24 13:40:48 »
Hello all,

I have been trying to convert Canon's raw files to RGB images, Hasn't worked so far and I don't really know where to start. My preprocessing always gives me a grayscale image. How do I preserve or utilize the color data in a set of CR2 files, so I can end up with color images? There must be tutorials about this.

Thank you very much, I know this is an awfully general question
James

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Re: making color images from CR2 files
« Reply #1 on: 2019 June 24 15:10:44 »
My preprocessing always gives me a grayscale image. How do I preserve or utilize the color data in a set of CR2 files, so I can end up with color images?

This is how it ought to be. The preprocessing shall be done on monochrome CFA images and results in monochrome CFA images.

Only after calibration (and optionally CosmeticCorrection), the monochrome CFA images are converted to RGB images. The workflow then is:
- Debayer (= conversion to RGB image),
- StarAlignment,
- ImageIntegration

or (preferred):
- Debayer (= conversion to RGB image),
- ImageRegistration (option 'Generate drizzle data' enabled),
- StarAlignment (option 'Generate drizzle data' enabled),
- Drizzle Integration (option 'CFA Drizzle' enabled).

Bernd

Offline wvanreeven

  • PixInsight Enthusiast
  • **
  • Posts: 82
Re: making color images from CR2 files
« Reply #2 on: 2019 June 24 23:54:19 »
I think in the preferred workflow ImageRegistration should (also) be ImageIntegration. Furthermore StarAlignment should be done before ImageIntegration. In other words:

or (preferred):
- Debayer (= conversion to RGB image),
- StarAlignment (option 'Generate drizzle data' enabled),
- ImageIntegration (option 'Generate drizzle data' enabled),
- Drizzle Integration (option 'CFA Drizzle' enabled).


Wouter

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Re: making color images from CR2 files
« Reply #3 on: 2019 June 25 02:18:25 »
Yes, I made a mistake. Wouter's corrected workflow for the application of CFA drizzle is of course the right one.

And No, CFA Drizzle is recommended, see:
https://pixinsight.com/forum/index.php?topic=13549.msg81718#msg81718 and
https://pixinsight.com/forum/index.php?topic=13504.msg81540#msg81540

My own experience with CFA drizzle are throughout positive.

Bernd

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
Re: making color images from CR2 files
« Reply #4 on: 2019 June 25 04:45:54 »
Thank you for the replies.

I assume "CFA" is just the generic term for Color Filter Array"? As with the Bayer matrix? But my starting images are color (CR2). I think I don't quite understand?

Thank you again.

James

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Re: making color images from CR2 files
« Reply #5 on: 2019 June 25 07:53:54 »
Yes, CFA is the abbreviation for Color Filter Array. Most DSLR and CMOS One Shot Color cameras have a Bayer matix of color filters in front of the sensor. In case of the widely-used RGGB matrix, this means alternating R and G filters or G and B filters in each row of pixels. A  4 x 4 pixel section of the sensor looks like this:

   R  G  R  G
   G  B  G  B
   R  G  R  G
   G  B  G  B

Each pixel of a raw image contains 1) the color information (i.e. either red, green or blue) and 2) an intensity. Nevertheless the raw CFA image (for a Canon DSLR camera: in the CR2 file) is monochrome (black and white). The color information is in the spatially separated pixels and has to be "developed" in order to generate a color image. This process, called debayering, is an interpolation. Assume that the sensor has w pixels in width and h pixels in height, making a number of total pixels of n = h * w. Then the sensor contains 0.25 * n pixels with red information, 0.5 * n with green information and 0.25 * n with blue information. The debayer alorithms interpolate the color information for all of the n pixels, and only after this "debayering", the CFA image is transformed into a RGB (color) image. If this description ist still unclear to you, I recommend to search the internet for the terms used here.

The preprocessing (calibration and cosmetic correction) can be performed on CFA images. This approach has the advantage of processing the raw (not interpolated) data and additionally of saving disk space for the intermediate files (master calibration files and calibrated light frames). After calibration (and optionally cosmetic correction) the debayering process is necessary, and not before this step a color image is generated.

Bernd

Offline jamesRC

  • PixInsight Addict
  • ***
  • Posts: 102
Re: making color images from CR2 files
« Reply #6 on: 2019 June 25 09:55:03 »
Thank you, Bernd.

The answers to my question are all here in this topic. I just need a little bit of trial-and-error.

James