lsst.pipe.tasks gd5638573c2+392ae78cd2
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.

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.

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",
},
)

The documentation for this class was generated from the following file:
  • python/lsst/pipe/tasks/prettyPictureMaker/_functors/_gamut_fixer.py