Color pipeline#

Stretch greyscale FITS data, tint each layer, and sum channels the classic way. Narrative: Intensity scaling, Color compositing.

Stretch & rescale#

rescale_image

Rescale image data to the [0,1] range with the specified stretch function and manual interval.

zscale_limits

Compute display limits using the IRAF zscale algorithm (astropy.visualization.ZScaleInterval).

make_norm

Create a matplotlib Normalize for display or rescale_image.

adjust_gamma

Replacement function for skimage.exposure.adjust_gamma, so that NaNs don't throw errors

stretch_functions

Name → astropy stretch class for unsigned rescale_image / make_norm.

SIGNED_STRETCHES

Built-in immutable sequence.

STRETCHES

Built-in mutable sequence.

nan_percentile_of_score

Usage is identical to scipy.stats.percentileofscore(array_in,score), this just corrects for NaNs

draw_progress_bar

Dependency-free ANSI progress bar written to stdout.

The built-in draw_progress_bar() is a zero-dependency ANSI stdout bar (used by reproject_cube() when print_progress=True). For richer progress in your own loops, use tqdm directly — see the function docstring for a side-by-side example. Multicolorfits does not depend on or wrap tqdm.

Colorize#

to_grey_rgb

Stretch a 2D intensity array and expand it to a greyscale RGB cube in [0, 1].

colorize_image

Add color of the given hue to an RGB greyscale image.

colorize_image_direct_rgb

Tint a greyscale RGB cube by multiplying channels with a solid hex color.

smooth_image

Apply isotropic Gaussian smoothing to a 2D or multichannel image.

hex_to_rgb

Converts a hexadecimal string to RGB tuple

rgb_to_hex

Converts RGB tuple to a hexadecimal string

hex_to_hsv

Convert a hexadecimal string to HSV tuple

hex_complement

Return the complementary hex color (bitwise inverse on the RGB cube).

to_hex

Convert c to a hex color.

Combine (classic RGB)#

combine_multicolor

Combines input colorized RGB images [:,:,3] into one intensity-rescaled RGB image

plot_combined_rgb

Plot a multicolor RGB image with WCS axes and save it to disk.

compare_multicolor_vs_rgb

Side-by-side comparison of a conventional RGB stack and a multicolor composite; saves the figure to disk.

save_rgb_fits

Write a multicolor RGB cube to a FITS file with the shared WCS header.