Skip to content

Densiometry

densiometry

Here data and functions for handling and specifying density values is included.

Functions:

  • adx16_decode

    Converts from ADX16 values to absolute APD density.

  • adx16_encode

    Converts from absolute APD density values to ADX16 values.

  • compute_printer_lights

    Converts the APD printer light to a three light matrix by splitting into separate

  • compute_xyz_dual

    Computes XYZ color matching functions and their dual with a least squares fit to the

  • interpolate_status_density

    Converts logarithmic status density values to a normalized linear status density

adx16_decode

adx16_decode(adx: ndarray, apd_min=None, scaling=1.0)

Converts from ADX16 values to absolute APD density. Instead of as 16 bit int the output is expected as a float in the range [0, 1].

Parameters:

  • adx

    (ndarray) –

    ADX16 values in the range [0, 1].

  • apd_min

    The D-min values of the film that has been compensated for.

  • scaling

    Linear scaling removed from the values. For 1.0 it is ADX16-like and for 4.0 it is ADX10-like.

Returns:

  • Absolute APD density values.

adx16_encode

adx16_encode(apd: ndarray, apd_min=None, scaling=1.0) -> ndarray

Converts from absolute APD density values to ADX16 values. Instead of as 16 bit int the output is encoded as a float in the range [0, 1].

Parameters:

  • apd

    (ndarray) –

    The density values.

  • apd_min

    The D-min values of the film to compensate for.

  • scaling

    Linear scaling applied to the values. For 1.0 it is ADX16-like and for 4.0 it is ADX10-like.

Returns:

  • ndarray

    ADX-like encoded values in the [0, 1] range.

compute_printer_lights

compute_printer_lights() -> ndarray

Converts the APD printer light to a three light matrix by splitting into separate red, green, and blue lights.

compute_xyz_dual

compute_xyz_dual(CCT=7000, spectral_shape=spectral_shape) -> tuple[ndarray, ndarray]

Computes XYZ color matching functions and their dual with a least squares fit to the rawtoaces training data set. Is used to get a simple but physically based linear conversion from XYZ values to a spectrum.

Returns:

  • tuple[ndarray, ndarray]

    A tuple (xyz_cmfs, xyz_dual).

interpolate_status_density

interpolate_status_density(
    status: list[dict[int, float]], spectral_shape=spectral_shape
) -> ndarray

Converts logarithmic status density values to a normalized linear status density matrix.