Author Topic: PixInsight 1.7 — New Format Hints  (Read 11229 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
PixInsight 1.7 — New Format Hints
« on: 2011 June 05 13:12:19 »
Introduction

PixInsight 1.7 introduces a new feature that may have passed unnoticed for many users: format hints. Format hints are special parameters that you can pass to file format support modules to override global settings for specific file formats. The necessity to override format settings in PixInsight has arisen a number of times during the last year and a half, especially in software development contexts, and also more recently at the user level; an example is this forum thread, where I devised the concept of format hints clearly for the first time.


Examples

The usefulness of format hints is better understood through examples. The ImageCalibration tool provides a good one. So far when ImageCalibration loaded DSLR raw frames, the current settings available in the RAW Format Preferences dialog of the DSLR_RAW module (available from the Format Explorer window) always applied. If you wanted to load your family photos in PixInsight, you had to change DSLR_RAW settings to select an appropriate debayering interpolation algorithm and enable camera white balance. Later, to calibrate a set of astronomical images you had to remember changing DSLR_RAW settings again to disable debayering, white balance, black point correction, etc., in order to load pure raw data. This no longer happens in PixInsight 1.7, thanks to format hints.

Several processes allow you to specify format hints directly: ImageCalibration, StarAlignment, ImageIntegration and HDRComposition. Input hints apply to image read operations, while output hints apply to generation of new image files. Only ImageCalibration and StarAlignment allow you to specify output hints, since the other processes cannot write image files.

Let's put a more practical example. To solve the problem I have described above with ImageCalibration (family photos), you can specify the following input hint on the ImageCalibration tool:

raw

The raw hint tells the DSLR_RAW module to load pure raw data, irrespective of the current DSLR raw format settings. Specifying the raw hint forces the DSLR_RAW module to override its current settings with the following set:

Color adjustment: all three scaling factors = 1.0
Interpolation: none
Auto white balance: disabled
Camera white balance: disabled
Create RAW Bayer image: enabled
Black point correction: disabled

So if you specify the raw input hint, ImageCalibration will load pure raw RGB Bayer images for DSLR raw input frames in a predictable way. If you want to load CFA monochrome images instead of RGB, you can also specify the cfa hint. So your input hints would be in this case:

raw cfa

More examples. Let's say you want to calibrate a set of FITS files acquired with an amateur package that stores FITS images using the typical top-to-bottom, left-to-right orientation (TBLR). As you know, PixInsight uses the bottom-to-top, left-to-right orientation (BTLR) by default. You can override this setting and define an ImageCalibration instance that loads FITS files using the TBLR convention always, irrespective of the current FITS format settings. To achieve this you just have to specify the following input hint:

up-bottom

In this way ImageCalibration will load your raw FITS files with the correct orientation. It will write the calibrated frames using the current orientation set in FITS preferences unless you repeat up-bottom as an output hint.

Continuing with FITS format issues, as you probably know floating point FITS files are the cause of a good amount of problems, mainly due to the lack of standardization characteristic of the FITS format, and particularly because FITS provides no way to specify the numerical range to which floating point data are referred (black and white points). Many image acquisition programs and some astronomical image manipulation applications write 32-bit floating point images in the range [0.0,65535.0], that is, a real range bounded as the 16-bit unsigned integer range. PixInsight, on the other hand, uses the [0,1] range for floating point image data by default, where 0=black and 1=white. Now you can force ImageCalibration to load floating point FITS files generated by other applications in the 16-bit range, using the TBLR orientation, with the following hints:

up-bottom lower-range 0 upper-range 65535

Again, the above hints will allow you to correctly interpret FITS files generated by other applications, without the need to alter global FITS settings. Note that lower-range and upper-range can only be used as input hints; PixInsight will always write floating point images in the [0,1] range.


Format Hints Reference

Here is a list of all input and output hints available in the standard file format support modules, as of PixInsight 1.7.0.697:


DSLR RAW Format

Input hints

raw
Equivalent to:
bayer-drizzle no-cfa no-auto-white-balance no-camera-white-balance no-black-point-correction

bilinear
Enables the bilinear debayering interpolation algorithm.

vng
Enables the VNG debayering interpolation algorithm.

ppg
Enables the PPG debayering interpolation algorithm.

ahd
Enables the AHD debayering interpolation algorithm.

interpolate-as-4-colors
Enables the four-color interpolation option.

no-interpolate-as-4-colors
Disables the four-color interpolation option.

auto-white-balance
Enables automatic white balance.

no-auto-white-balance
Disables automatic white balance.

camera-white-balance
Enables camera white balance.

no-camera-white-balance
Disables camera white balance.

super-pixels
Enables super pixel debayering.

no-super-pixels
Disables super pixel debayering.

bayer-drizzle
Enables loading of RGB raw Bayer images.

no-bayer-drizzle
Disables loading of RGB raw Bayer images.

cfa
Enables loading of monochrome raw CFA (color filter array) images.

no-cfa
Disables loading of monochrome raw CFA images.

black-point-correction
Enables black point correction.

no-black-point-correction
Disables black point correction.


FITS Format

Input hints

lower-range <real-number>
Specifies the lower bound of the input range for floating point FITS images.

upper-range <real-number>
Specifies the upper bound of the input range for floating point FITS images.

rescale
Specifies that input images with out-of-range pixel values will be rescaled to the current floating point input range (no data loss).

truncate
Specifies that input images with out-of-range pixel values will be truncated to the current floating point input range (possible data loss).

bottom-up
Selects the bottom-to-top, left-to-right FITS coordinate origin and orientation.

up-bottom
Selects the top-to-bottom, left-to-right FITS coordinate origin and orientation.

signed-is-physical
Specifies that signed integer FITS images store physical CCD raw values. In these images, the negative half of the available numerical range is not used. Pixel values range from 0 to 2n-1-1, where n is the bit depth.

signed-is-logical
Specifies that signed integer FITS images store logical values. In these images, the entire available numerical range is used. Pixel values range from -2n-1 to +2n-1-1, where n is the bit depth.

Output hints

unsigned
Writes an unsigned integer FITS image (if an integer image is being generated).

signed
Writes a signed integer FITS image (if an integer image is being generated).

bottom-up
Writes a FITS image with the bottom-to-top, left-to-right FITS coordinate origin and orientation.

up-bottom
Writes a FITS image with the top-to-bottom, left-to-right FITS coordinate origin and orientation.


TIFF Format

Input hints

lower-range <real-number>
Specifies the lower bound of the input range for floating point TIFF images.

upper-range <real-number>
Specifies the upper bound of the input range for floating point TIFF images.

rescale
Specifies that input images with out-of-range pixel values will be rescaled to the current floating point input range (no data loss).

truncate
Specifies that input images with out-of-range pixel values will be truncated to the current floating point input range (possible data loss).

Output hints

zip-compression
Writes a TIFF file using ZIP (deflate) compression.

lzw-compression
Writes a TIFF file using the LZW compression algorithm.

uncompressed
Writes an uncompressed TIFF file.

no-compression
Same as uncompressed

planar
Writes a planar TIFF file (in a planar TIFF image, each color channel of the image is stored as an independent matrix of pixel components).

chunky
Writes a chunky TIFF file (in a chunky TIFF image, all color channels are written interlaced as a single block of data).

no-planar
Same as chunky.

associated-alpha
The alpha channel represents the opacity of the image.

no-associated-alpha
The alpha channel is an independent data set that does not represent the opacity of the image.

premultiplied-alpha
Color pixel components are stored premultiplied by the alpha component.

no-premultiplied-alpha
Color pixel components are stored unmodified.


JPEG Format

Output hints

quality <integer-number>
Specifies a quality factor in the range [0,100].

optimized
Enables optimized entropy coding.

no-optimized
Disables optimized entropy coding.

arithmetic
Selects the arithmetic entropy coding algorithm (currently unsupported by the standard JPEG file format module).

huffman
Selects the Huffman entropy coding algorithm.

progressive
Create a JPEG image that can be loaded by successive layers of increasing resolution.

no-progressive
Do not create a progrssive JPEG image.
« Last Edit: 2011 June 05 13:22:31 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Alejandro Tombolini

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1267
    • Próxima Sur
Re: PixInsight 1.7 — New Format Hints
« Reply #1 on: 2011 June 05 14:26:55 »
Hola Juan, usé "raw" en ImageCalibration y funciona perfecto. Es mucho más cómodo no tener que cambiar los seteos del Raw Format Preferences.
Lo que no entiendo muy bien es que podría especificar en StarAlignment siendo que con ImageCalibration y con BatchDebayer obtengo el .fit que necesito.   

Saludos. Alejandro.   

Hi Juan, I used "raw" in ImageCalibration and it works perfectly. It is much more comfortable not to change the setings of Raw Format Preferences. 
What I do not understand very well is what I might specify in StarAlignment being that with ImageCalibration and BatchDebayer I obtain the .fit that is needed.