PixInsight 1.7 ? New Format Hints

Juan Conejero

PixInsight Staff
Staff member
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:

Code:
raw

The
Code:
raw
hint tells the DSLR_RAW module to load pure raw data, irrespective of the current DSLR raw format settings. Specifying the
Code:
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
Code:
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
Code:
cfa
hint. So your input hints would be in this case:

Code:
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:

Code:
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
Code:
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:

Code:
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
Code:
lower-range
and
Code:
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

Code:
[b]raw[/b]
Equivalent to:
Code:
bayer-drizzle no-cfa no-auto-white-balance no-camera-white-balance no-black-point-correction

Code:
[b]bilinear[/b]
Enables the bilinear debayering interpolation algorithm.

Code:
[b]vng[/b]
Enables the VNG debayering interpolation algorithm.

Code:
[b]ppg[/b]
Enables the PPG debayering interpolation algorithm.

Code:
[b]ahd[/b]
Enables the AHD debayering interpolation algorithm.

Code:
[b]interpolate-as-4-colors[/b]
Enables the four-color interpolation option.

Code:
[b]no-interpolate-as-4-colors[/b]
Disables the four-color interpolation option.

Code:
[b]auto-white-balance[/b]
Enables automatic white balance.

Code:
[b]no-auto-white-balance[/b]
Disables automatic white balance.

Code:
[b]camera-white-balance[/b]
Enables camera white balance.

Code:
[b]no-camera-white-balance[/b]
Disables camera white balance.

Code:
[b]super-pixels[/b]
Enables super pixel debayering.

Code:
[b]no-super-pixels[/b]
Disables super pixel debayering.

Code:
[b]bayer-drizzle[/b]
Enables loading of RGB raw Bayer images.

Code:
[b]no-bayer-drizzle[/b]
Disables loading of RGB raw Bayer images.

Code:
[b]cfa[/b]
Enables loading of monochrome raw CFA (color filter array) images.

Code:
[b]no-cfa[/b]
Disables loading of monochrome raw CFA images.

Code:
[b]black-point-correction[/b]
Enables black point correction.

Code:
[b]no-black-point-correction[/b]
Disables black point correction.


FITS Format

Input hints

Code:
[b]lower-range [i]<real-number>[/i][/b]
Specifies the lower bound of the input range for floating point FITS images.

Code:
[b]upper-range [i]<real-number>[/i][/b]
Specifies the upper bound of the input range for floating point FITS images.

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

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

Code:
[b]bottom-up[/b]
Selects the bottom-to-top, left-to-right FITS coordinate origin and orientation.

Code:
[b]up-bottom[/b]
Selects the top-to-bottom, left-to-right FITS coordinate origin and orientation.

Code:
[b]signed-is-physical[/b]
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.

Code:
[b]signed-is-logical[/b]
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

Code:
[b]unsigned[/b]
Writes an unsigned integer FITS image (if an integer image is being generated).

Code:
[b]signed[/b]
Writes a signed integer FITS image (if an integer image is being generated).

Code:
[b]bottom-up[/b]
Writes a FITS image with the bottom-to-top, left-to-right FITS coordinate origin and orientation.

Code:
[b]up-bottom[/b]
Writes a FITS image with the top-to-bottom, left-to-right FITS coordinate origin and orientation.


TIFF Format

Input hints

Code:
[b]lower-range [i]<real-number>[/i][/b]
Specifies the lower bound of the input range for floating point TIFF images.

Code:
[b]upper-range [i]<real-number>[/i][/b]
Specifies the upper bound of the input range for floating point TIFF images.

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

Code:
[b]truncate[/b]
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

Code:
[b]zip-compression[/b]
Writes a TIFF file using ZIP (deflate) compression.

Code:
[b]lzw-compression[/b]
Writes a TIFF file using the LZW compression algorithm.

Code:
[b]uncompressed[/b]
Writes an uncompressed TIFF file.

Code:
[b]no-compression[/b]
Same as
Code:
uncompressed

Code:
[b]planar[/b]
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).

Code:
[b]chunky[/b]
Writes a chunky TIFF file (in a chunky TIFF image, all color channels are written interlaced as a single block of data).

Code:
[b]no-planar[/b]
Same as
Code:
chunky
.

Code:
[b]associated-alpha[/b]
The alpha channel represents the opacity of the image.

Code:
[b]no-associated-alpha[/b]
The alpha channel is an independent data set that does not represent the opacity of the image.

Code:
[b]premultiplied-alpha[/b]
Color pixel components are stored premultiplied by the alpha component.

Code:
[b]no-premultiplied-alpha[/b]
Color pixel components are stored unmodified.


JPEG Format

Output hints

Code:
[b]quality [i]<integer-number>[/i][/b]
Specifies a quality factor in the range [0,100].

Code:
[b]optimized[/b]
Enables optimized entropy coding.

Code:
[b]no-optimized[/b]
Disables optimized entropy coding.

Code:
[b]arithmetic[/b]
Selects the arithmetic entropy coding algorithm (currently unsupported by the standard JPEG file format module).

Code:
[b]huffman[/b]
Selects the Huffman entropy coding algorithm.

Code:
[b]progressive[/b]
Create a JPEG image that can be loaded by successive layers of increasing resolution.

Code:
[b]no-progressive[/b]
Do not create a progrssive JPEG image.
 
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.
 
Back
Top