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:
The
hint tells the DSLR_RAW module to load pure raw data, irrespective of the current DSLR raw format settings. Specifying the
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
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
hint. So your input hints would be in this case:
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:
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
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:
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
and
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
Equivalent to:
Enables the bilinear debayering interpolation algorithm.
Enables the VNG debayering interpolation algorithm.
Enables the PPG debayering interpolation algorithm.
Enables the AHD debayering interpolation algorithm.
Enables the four-color interpolation option.
Disables the four-color interpolation option.
Enables automatic white balance.
Disables automatic white balance.
Enables camera white balance.
Disables camera white balance.
Enables super pixel debayering.
Disables super pixel debayering.
Enables loading of RGB raw Bayer images.
Disables loading of RGB raw Bayer images.
Enables loading of monochrome raw CFA (color filter array) images.
Disables loading of monochrome raw CFA images.
Enables black point correction.
Disables black point correction.
FITS Format
Input hints
Specifies the lower bound of the input range for floating point FITS images.
Specifies the upper bound of the input range for floating point FITS images.
Specifies that input images with out-of-range pixel values will be rescaled to the current floating point input range (no data loss).
Specifies that input images with out-of-range pixel values will be truncated to the current floating point input range (possible data loss).
Selects the bottom-to-top, left-to-right FITS coordinate origin and orientation.
Selects the top-to-bottom, left-to-right FITS coordinate origin and orientation.
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.
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
Writes an unsigned integer FITS image (if an integer image is being generated).
Writes a signed integer FITS image (if an integer image is being generated).
Writes a FITS image with the bottom-to-top, left-to-right FITS coordinate origin and orientation.
Writes a FITS image with the top-to-bottom, left-to-right FITS coordinate origin and orientation.
TIFF Format
Input hints
Specifies the lower bound of the input range for floating point TIFF images.
Specifies the upper bound of the input range for floating point TIFF images.
Specifies that input images with out-of-range pixel values will be rescaled to the current floating point input range (no data loss).
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
Writes a TIFF file using ZIP (deflate) compression.
Writes a TIFF file using the LZW compression algorithm.
Writes an uncompressed TIFF file.
Same as
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).
Writes a chunky TIFF file (in a chunky TIFF image, all color channels are written interlaced as a single block of data).
Same as
.
The alpha channel represents the opacity of the image.
The alpha channel is an independent data set that does not represent the opacity of the image.
Color pixel components are stored premultiplied by the alpha component.
Color pixel components are stored unmodified.
JPEG Format
Output hints
Specifies a quality factor in the range [0,100].
Enables optimized entropy coding.
Disables optimized entropy coding.
Selects the arithmetic entropy coding algorithm (currently unsupported by the standard JPEG file format module).
Selects the Huffman entropy coding algorithm.
Create a JPEG image that can be loaded by successive layers of increasing resolution.
Do not create a progrssive JPEG image.
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
Code:
raw
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
Code:
cfa
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
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
Code:
upper-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]
Code:
bayer-drizzle no-cfa no-auto-white-balance no-camera-white-balance no-black-point-correction
Code:
[b]bilinear[/b]
Code:
[b]vng[/b]
Code:
[b]ppg[/b]
Code:
[b]ahd[/b]
Code:
[b]interpolate-as-4-colors[/b]
Code:
[b]no-interpolate-as-4-colors[/b]
Code:
[b]auto-white-balance[/b]
Code:
[b]no-auto-white-balance[/b]
Code:
[b]camera-white-balance[/b]
Code:
[b]no-camera-white-balance[/b]
Code:
[b]super-pixels[/b]
Code:
[b]no-super-pixels[/b]
Code:
[b]bayer-drizzle[/b]
Code:
[b]no-bayer-drizzle[/b]
Code:
[b]cfa[/b]
Code:
[b]no-cfa[/b]
Code:
[b]black-point-correction[/b]
Code:
[b]no-black-point-correction[/b]
FITS Format
Input hints
Code:
[b]lower-range [i]<real-number>[/i][/b]
Code:
[b]upper-range [i]<real-number>[/i][/b]
Code:
[b]rescale[/b]
Code:
[b]truncate[/b]
Code:
[b]bottom-up[/b]
Code:
[b]up-bottom[/b]
Code:
[b]signed-is-physical[/b]
Code:
[b]signed-is-logical[/b]
Output hints
Code:
[b]unsigned[/b]
Code:
[b]signed[/b]
Code:
[b]bottom-up[/b]
Code:
[b]up-bottom[/b]
TIFF Format
Input hints
Code:
[b]lower-range [i]<real-number>[/i][/b]
Code:
[b]upper-range [i]<real-number>[/i][/b]
Code:
[b]rescale[/b]
Code:
[b]truncate[/b]
Output hints
Code:
[b]zip-compression[/b]
Code:
[b]lzw-compression[/b]
Code:
[b]uncompressed[/b]
Code:
[b]no-compression[/b]
Code:
uncompressed
Code:
[b]planar[/b]
Code:
[b]chunky[/b]
Code:
[b]no-planar[/b]
Code:
chunky
Code:
[b]associated-alpha[/b]
Code:
[b]no-associated-alpha[/b]
Code:
[b]premultiplied-alpha[/b]
Code:
[b]no-premultiplied-alpha[/b]
JPEG Format
Output hints
Code:
[b]quality [i]<integer-number>[/i][/b]
Code:
[b]optimized[/b]
Code:
[b]no-optimized[/b]
Code:
[b]arithmetic[/b]
Code:
[b]huffman[/b]
Code:
[b]progressive[/b]
Code:
[b]no-progressive[/b]