ImageConverter
- class ImageConverter
The ImageConverter class which corresponds to the C++ class
rta::util::ImageConverter. It allows high level raw file conversion.Usage examples:
import rawtoaces converter = rawtoaces.ImageConverter() converter.process_image("/path/to/input/file.CR3")
This will convert the input file “/path/to/input/file.CR3” using the default settings, and create the output file “/path/to/input/file_aces.exr” in the same directory.
import rawtoaces converter = rawtoaces.ImageConverter() converter.settings.WB_method == rawtoaces.ImageConverter.Settings.WBMethod.Illuminant converter.settings.illuminant = "3200K" converter.settings.output_dir = "/path/to/output" converter.process_image("/path/to/an/image/file.CR3")
This will convert the input file “/path/to/input/file.CR3” white-balancing to the colour temperature of 3200K, and create the output file “/path/to/output/file_aces.exr” at the provided location.
- class Settings
The structure containing all parameters needed to configure image conversion. This class corresponds to the C++
rta::util::ImageConverter::Settings.- class WBMethod
The enumerator containing all supported white-balancing methods:
Metadata Illuminant Box Custom
See
rta::util::ImageConverter::Settings::WBMethodfor more information on each supported method.
- WBMethod WB_method
The selected white-balancing method to use for conversion.
- class MatrixMethod
The enumerator containing all supported colour transform matrix calculation methods:
Auto Spectral Metadata Adobe Custom
See
rta::util::ImageConverter::Settings::MatrixMethodfor more information on each supported method.
- MatrixMethod matrix_method
The selected colour transform matrix calculation method to use for conversion.
- class CropMode
The enumerator containing all supported crop modes:
Off Soft Hard
See
rta::util::ImageConverter::Settings::CropModefor more information on each supported mode.
- CropMode crop_mode
The selected cropping mode to use for conversion.
- str illuminant
An illuminant to use for white balancing and/or colour matrix calculation. See
rta::util::ImageConverter::Settings::illuminantfor more information.
- float headroom
Highlight headroom factor.
- str custom_camera_make
Camera manufacturer name to be used for spectral sensitivity curves lookup.
- str custom_camera_model
Camera model name to be used for spectral sensitivity curves lookup.
- bool auto_bright
Enable automatic exposure adjustment.
- bool adjust_maximum_threshold
Automatically lower the linearity threshold provided in the metadata by this scaling factor.
- float black_level
If non-negative, override the black level specified in the file metadata.
- float saturation_level
If non-negative, override the saturation level specified in the file metadata.
- bool half_size
Decode the image at half size resolution.
- int highlight_mode
Highlight recovery mode, as supported by OpenImageIO/Libraw. 0 = clip, 1 = unclip, 2 = blend, 3..9 = rebuild.
- int flip
If not 0, override the orientation specified in the metadata. 1..8 correspond to EXIF orientation codes (3 = 180 deg, 6 = 90 deg CCW, 8 = 90 deg CW.)
- float denoise_threshold
Wavelet denoising threshold.
- float scale
Additional scaling factor to apply to the pixel values.
- str demosaic_algorithm
Demosaicing algorithm. Supported options:
linear VNG PPG AHD DCB AHD-Mod AFD VCD Mixed LMMSE AMaZE DHT AAHD AHD'
- list[str] database_directories
Directory containing rawtoaces spectral sensitivity and illuminant data files. Overrides the default search path and the RAWTOACES_DATA_PATH environment variable.
- bool overwrite
Allows overwriting existing files.
- bool create_dirs
Create output directories if they don’t exist.
- str output_dir
The directory to write the output files to.
- bool use_timing
Log the execution time of each step of image processing.
- int verbosity
Verbosity level.
- list[int] WB_box
Box to use for white balancing when WB_method == WBMethod::Box, (default = (0,0,0,0) - full image).
- list[int] crop_box
Apply custom crop. If not specified (all values are zeroes), the default crop is applied, which should match the crop of the in-camera JPEG.
- list[float] custom_WB
Custom white balance multipliers to be used when WB_method == WBMethod::Custom.
- list[float] custom_matrix
Custom camera RGB to XYZ matrix to be used when matrix_method == MatrixMethod::Custom.
- list[float] chromatic_aberration
Red and blue scale factors for chromatic aberration correction.
- Settings settings
The conversion settings.
- bool process_image(str)
A convenience single-call method to process an image. See
rta::util::ImageConverter::process_image()for more information.
- list[str] get_supported_illuminants()
Collects all illuminants supported by this version.
- list[str] get_supported_cameras()
Collects all camera models for which spectral sensitivity data is available in the database.
- bool configure(str)
Configures the converter using the requested white balance and colour matrix method, and the metadata of the file provided in input_file. See
rta::util::ImageConverter::configure()for more information.
- list[float] get_WB_multipliers()
Get the solved white balance multipliers of the currently processed image. See
rta::util::ImageConverter::get_WB_multipliers()for more information.
- list[float] get_IDT_matrix()
Get the solved input transform matrix of the currently processed image. See
rta::util::ImageConverter::get_IDT_matrix()for more information.
- list[float] get_CAT_matrix()
Get the solved chromatic adaptation transform matrix of the currently processed image. See
rta::util::ImageConverter::get_CAT_matrix()for more information.
- list[list[str]] collect_image_files(list[str])
Collect all files from given paths into batches. See
rta::util::collect_image_files()for more information.