lsst.pipe.tasks g253578fa50+9bdef6ea54
Loading...
Searching...
No Matches
lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor Class Reference
Inheritance diagram for lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor:

Public Member Functions

FloatImagePlane __call__ (self, FloatImagePlane intensities)
 

Static Public Attributes

 stretch = Field[float](doc="The stretch of the luminance in asinh", default=400)
 
 max = Field[float](doc="The maximum allowed luminance on a 0 to 1 scale", default=0.85)
 
 floor = Field[float](doc="A value in nJy that is used to map luminances to a very dark gray", default=0.0)
 
 Q
 
 highlight
 
 shadow
 
 midtone
 
 equalizerLevels
 
 toneAdjustment
 
 toneWidth
 
 doDenoise = Field[bool](doc="Denoise the luminance image", default=False)
 

Detailed Description

Compress and enhance luminance using multi-stage processing.

This class implements luminance compression for RGB image generation using
a multi-stage algorithm that includes:

- Asinh stretching for non-linear brightness mapping
- Linear contrast manipulation
- Midtone adjustment
- Optional Gaussian denoising
- Optional contrast equalization
- Optional tone adjustment

The configuration fields control the parameters for each stage of the
processing pipeline.

Definition at line 41 of file _lum_scale.py.

Member Function Documentation

◆ __call__()

FloatImagePlane lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.__call__ ( self,
FloatImagePlane intensities )
Compress and enhance luminance using multi-stage processing.

This method applies the configured luminance compression algorithm to
the input image. The processing pipeline includes optional denoising,
asinh stretching, linear contrast manipulation, midtone adjustment,
contrast equalization, and tone adjustment.

Parameters
----------
intensities : `FloatImagePlane`
    Input image with pixel intensities. This FloatImagePlane should
    contain the luminance data to be compressed.

Returns
-------
result : `FloatImagePlane`
    The processed image with luminance compression applied. Values
    are clipped to the range [0, 1].

Notes
-----
The processing pipeline consists of the following stages:

1. Optional wavelet denoising if doDenoise is True
2. Asinh stretching with configurable stretch parameter
3. Linear contrast adjustment using highlight, shadow parameters
4. Midtone adjustment using midtone parameter
5. Optional contrast equalization if equalizerLevels is configured
6. Optional tone adjustment if toneAdjustment is configured
7. Final clipping to [0, 1] range

The configuration fields (stretch, highlight, shadow, midtone,
equalizerLevels, toneAdjustment, toneWidth) control the behavior
of each processing stage.

Definition at line 107 of file _lum_scale.py.

Member Data Documentation

◆ doDenoise

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.doDenoise = Field[bool](doc="Denoise the luminance image", default=False)
static

Definition at line 105 of file _lum_scale.py.

◆ equalizerLevels

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.equalizerLevels
static
Initial value:
= ListField[float](
doc=(
"A list of factors to modify the constrast in a scale-dependent way. "
"One coefficient for each spatial scale, starting from the largest. "
"Values large than 1 increase contrast, while less than 1 decreases. "
"This adjustment is multiplicative. "
"Only scales upto and including the largest to be modified need specified, "
"i.e. [1.1,0.9] modifies the first two [1.1,1,0.9] modifies the first three."
),
optional=True,
)

Definition at line 75 of file _lum_scale.py.

◆ floor

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.floor = Field[float](doc="A value in nJy that is used to map luminances to a very dark gray", default=0.0)
static

Definition at line 60 of file _lum_scale.py.

◆ highlight

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.highlight
static
Initial value:
= Field[float](
doc="The value of highlights in scaling factor applied to post asinh streaching", default=1.0
)

Definition at line 66 of file _lum_scale.py.

◆ max

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.max = Field[float](doc="The maximum allowed luminance on a 0 to 1 scale", default=0.85)
static

Definition at line 59 of file _lum_scale.py.

◆ midtone

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.midtone
static
Initial value:
= Field[float](
doc="The value of midtone in scaling factor applied to post asinh streaching", default=0.5
)

Definition at line 72 of file _lum_scale.py.

◆ Q

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.Q
static
Initial value:
= Field[float](
doc="softening parameter",
default=0.7,
deprecated="This field is no longer used and will be removed after v31.",
)

Definition at line 61 of file _lum_scale.py.

◆ shadow

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.shadow
static
Initial value:
= Field[float](
doc="The value of shadows in scaling factor applied to post asinh streaching", default=0.0
)

Definition at line 69 of file _lum_scale.py.

◆ stretch

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.stretch = Field[float](doc="The stretch of the luminance in asinh", default=400)
static

Definition at line 58 of file _lum_scale.py.

◆ toneAdjustment

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.toneAdjustment
static
Initial value:
= ListField[float](
doc=(
"A list of length 10 that adjusts the brightness of the image ranging "
"from dark regions to light. These 10 values represent control points along "
"the lumanance interval 0-1, but the actual adjustments made are continuous "
"and are calculated from these control points."
),
length=10,
optional=True,
)

Definition at line 86 of file _lum_scale.py.

◆ toneWidth

lsst.pipe.tasks.prettyPictureMaker._functors._lum_scale.LumCompressor.toneWidth
static
Initial value:
= Field[float](
doc=(
"This parameters controls how each tone control point affect the adjustment "
"of the values in between. Increase the value to have a more continuous "
"change between control points, decrease to make the control sharper. Value "
"must be greater than zero."
),
default=0.07,
)

Definition at line 96 of file _lum_scale.py.


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