Params class

class rawpy.Params(self, demosaic_algorithm: Optional[DemosaicAlgorithm] = None, bool half_size: bool = False, bool four_color_rgb: bool = False, int dcb_iterations: int = 0, bool dcb_enhance: bool = False, fbdd_noise_reduction: FBDDNoiseReductionMode = FBDDNoiseReductionMode.Off, float noise_thr: Optional[float] = None, int median_filter_passes: int = 0, bool use_camera_wb: bool = False, bool use_auto_wb: bool = False, list user_wb: Optional[List[float]] = None, output_color: ColorSpace = ColorSpace.sRGB, int output_bps: int = 8, int user_flip: Optional[int] = None, int user_black: Optional[int] = None, list user_cblack: Optional[List[int]] = None, int user_sat: Optional[int] = None, bool no_auto_bright: bool = False, float auto_bright_thr: Optional[float] = None, double adjust_maximum_thr: float = 0.75, double bright: float = 1.0, highlight_mode: Union[HighlightMode, int] = HighlightMode.Clip, float exp_shift: Optional[float] = None, double exp_preserve_highlights: float = 0.0, bool no_auto_scale: bool = False, tuple gamma: Optional[Tuple[float, float]] = None, tuple chromatic_aberration: Optional[Tuple[float, float]] = None, str bad_pixels_path: Optional[str] = None)

A class that handles postprocessing parameters.

If use_camera_wb and use_auto_wb are False and user_wb is None, then daylight white balance correction is used. If both use_camera_wb and use_auto_wb are True, then use_auto_wb has priority.

Parameters:
  • demosaic_algorithm (rawpy.DemosaicAlgorithm) – default is AHD

  • half_size (bool) – outputs image in half size by reducing each 2x2 block to one pixel instead of interpolating

  • four_color_rgb (bool) – whether to use separate interpolations for two green channels

  • dcb_iterations (int) – number of DCB correction passes, requires DCB demosaicing algorithm

  • dcb_enhance (bool) – DCB interpolation with enhanced interpolated colors

  • fbdd_noise_reduction (rawpy.FBDDNoiseReductionMode) – controls FBDD noise reduction before demosaicing

  • noise_thr (float) – threshold for wavelet denoising (default disabled)

  • median_filter_passes (int) – number of median filter passes after demosaicing to reduce color artifacts

  • use_camera_wb (bool) – whether to use the as-shot white balance values

  • use_auto_wb (bool) – whether to try automatically calculating the white balance

  • user_wb (list) – list of length 4 with white balance multipliers for each color

  • output_color (rawpy.ColorSpace) – output color space

  • output_bps (int) – 8 or 16

  • user_flip (int) – 0=none, 3=180, 5=90CCW, 6=90CW, default is to use image orientation from the RAW image if available

  • user_black (int) – custom black level

  • user_cblack (list) – list of length 4 with per-channel corrections to user_black. These are offsets applied on top of user_black for [R, G, B, G2] channels.

  • user_sat (int) – saturation adjustment (custom white level)

  • no_auto_scale (bool) – Whether to disable pixel value scaling

  • no_auto_bright (bool) – whether to disable automatic increase of brightness

  • auto_bright_thr (float) – ratio of clipped pixels when automatic brighness increase is used (see no_auto_bright). Default is 0.01 (1%).

  • adjust_maximum_thr (float) – see libraw docs

  • bright (float) – brightness scaling

  • highlight_mode (rawpy.HighlightMode | int) – highlight mode

  • exp_shift (float) – exposure shift in linear scale. Usable range from 0.25 (2-stop darken) to 8.0 (3-stop lighter).

  • exp_preserve_highlights (float) – preserve highlights when lightening the image with exp_shift. From 0.0 to 1.0 (full preservation).

  • gamma (tuple) – pair (power,slope), default is (2.222, 4.5) for rec. BT.709

  • chromatic_aberration (tuple) – pair (red_scale, blue_scale), default is (1,1), corrects chromatic aberration by scaling the red and blue channels

  • bad_pixels_path (str) – path to dcraw bad pixels file. Each bad pixel will be corrected using the mean of the neighbor pixels. See the rawpy.enhance module for alternative repair algorithms, e.g. using the median.