lsst.pipe.tasks gcf790cdeb6+f6e4da7c1c
Loading...
Searching...
No Matches
lsst.pipe.tasks.prettyPictureMaker._functors._gamut_fixer.GamutFixer Class Reference
Inheritance diagram for lsst.pipe.tasks.prettyPictureMaker._functors._gamut_fixer.GamutFixer:

Public Member Functions

RGBImage __call__ (self, LABImage Lab, tuple[float, float] xyz_whitepoint)
 

Static Public Attributes

str gamutMethod
 
 max_size = Field[int](doc="Maximum number of contiguous pixels that will be fixed", default=10000)
 

Detailed Description

Fix out-of-gamut colors in images by remapping them back into the RGB gamut.

This class provides multiple methods for handling colors that fall outside
the standard RGB color gamut, including inpainting, mapping functions,
and diffusion-based healing.

Definition at line 139 of file _gamut_fixer.py.

Member Function Documentation

◆ __call__()

RGBImage lsst.pipe.tasks.prettyPictureMaker._functors._gamut_fixer.GamutFixer.__call__ ( self,
LABImage Lab,
tuple[float, float] xyz_whitepoint )
Remap colors that fall outside an RGB color gamut back into it.

When gamutMethod is 'heal', regions larger than the configured max_size
are skipped.

Parameters
----------
Lab : `LABImage`
    A NxMx3 array in the Lab colorspace containing the image data.
xyz_whitepoint : `tuple` of `float`, `float`
    Sets the white point of the xyz colorspace in xy coordinates.

Returns
-------
result : `RGBImage`
    The image with out-of-gamut colors remapped to RGB colorspace.

Raises
------
ValueError
    Raise if the gamut method is not one of the supported methods.

Definition at line 159 of file _gamut_fixer.py.

Member Data Documentation

◆ gamutMethod

str lsst.pipe.tasks.prettyPictureMaker._functors._gamut_fixer.GamutFixer.gamutMethod
static
Initial value:
= ChoiceField[str](
doc="If doRemapGamut is True this determines the method",
default="inpaint",
allowed={
"mapping": "Use a mapping function",
"inpaint": "Use surrounding pixels to determine likely value",
"heal": "Heal regions with reverse diffusion",
"none": "Don't fix out of gamut colors",
},
)

Definition at line 147 of file _gamut_fixer.py.

◆ max_size

lsst.pipe.tasks.prettyPictureMaker._functors._gamut_fixer.GamutFixer.max_size = Field[int](doc="Maximum number of contiguous pixels that will be fixed", default=10000)
static

Definition at line 157 of file _gamut_fixer.py.


The documentation for this class was generated from the following file: