### rawpy.imread() Source: https://letmaik.github.io/rawpy/api/index.html The main entry point to start working with RAW images. It returns a rawpy.RawPy object on which all further operations have to be performed. ```APIDOC ## rawpy.imread() ### Description Convenience function that creates a `rawpy.RawPy` instance, opens the given file, and returns the `rawpy.RawPy` instance for further processing. ### Method Function call ### Endpoint `rawpy.imread(pathOrFile, shot_select=0)` ### Parameters - **pathOrFile** (str or file-like object) - Required - Path or file object of RAW image that will be read. - **shot_select** (int) - Optional - Select which image to extract from RAW files that contain multiple images (e.g., Dual Pixel RAW). Default is 0 for the first/main image. ### Returns RawPy instance with the opened RAW image ### Return Type rawpy.RawPy ``` -------------------------------- ### Context manager usage with rawpy.imread Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Use a context manager to automatically close the RAW image and release resources. The example opens 'image.nef' and works with the raw object inside the with block. ```python with rawpy.imread('image.nef') as raw: # work with raw object ``` -------------------------------- ### auto_whitebalance property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html White balance coefficients used during postprocessing. This property returns the actual white balance multipliers that were used during postprocessing, regardless of the white balance mode. Must be accessed after calling postprocess() or dcraw_process() to get the coefficients that were actually applied. If accessed before postprocessing, it returns None. ```APIDOC ## auto_whitebalance property ### Description White balance coefficients used during postprocessing. This property returns the actual white balance multipliers that were used during postprocessing, regardless of the white balance mode. Must be accessed after calling postprocess() or dcraw_process() to get the coefficients that were actually applied. If accessed before postprocessing, it returns None. ### Type Optional[List[float]] ### Returns - **list** of length 4, or None if postprocessing hasn't been called yet. ``` -------------------------------- ### Other Source: https://letmaik.github.io/rawpy/api/namedtuples.html Named tuple representing miscellaneous camera settings. Create a new instance with the specified fields. ```APIDOC ## Other ### Description Create new instance of Other(iso_speed, shutter_speed, aperture, focal_length, timestamp, shot_order, artist) ### Constructor `rawpy.Other(iso_speed, shutter_speed, aperture, focal_length, timestamp, shot_order, artist)` ### Parameters - **iso_speed** (int) - Required - ISO speed - **shutter_speed** (float) - Required - Shutter speed - **aperture** (float) - Required - Aperture - **focal_length** (float) - Required - Focal length - **timestamp** (int) - Required - Timestamp - **shot_order** (int) - Required - Shot order - **artist** (str) - Required - Artist name ``` -------------------------------- ### ImageSizes Source: https://letmaik.github.io/rawpy/api/namedtuples.html Named tuple representing image size and crop information. Create a new instance with the specified fields. ```APIDOC ## ImageSizes ### Description Create new instance of ImageSizes(raw_height, raw_width, height, width, top_margin, left_margin, iheight, iwidth, pixel_aspect, flip, crop_left_margin, crop_top_margin, crop_width, crop_height) ### Constructor `rawpy.ImageSizes(raw_height, raw_width, height, width, top_margin, left_margin, iheight, iwidth, pixel_aspect, flip, crop_left_margin, crop_top_margin, crop_width, crop_height)` ### Parameters - **raw_height** (int) - Required - Raw image height - **raw_width** (int) - Required - Raw image width - **height** (int) - Required - Image height - **width** (int) - Required - Image width - **top_margin** (int) - Required - Top margin - **left_margin** (int) - Required - Left margin - **iheight** (int) - Required - Internal height - **iwidth** (int) - Required - Internal width - **pixel_aspect** (float) - Required - Pixel aspect ratio - **flip** (int) - Required - Flip orientation - **crop_left_margin** (int) - Required - Crop left margin - **crop_top_margin** (int) - Required - Crop top margin - **crop_width** (int) - Required - Crop width - **crop_height** (int) - Required - Crop height ``` -------------------------------- ### Thumbnail Source: https://letmaik.github.io/rawpy/api/namedtuples.html Named tuple representing thumbnail data. Create a new instance with the specified fields. ```APIDOC ## Thumbnail ### Description Create new instance of Thumbnail(format, data) ### Constructor `rawpy.Thumbnail(format, data)` ### Parameters - **format** (str) - Required - Thumbnail format - **data** (bytes) - Required - Thumbnail data ``` -------------------------------- ### rawpy.Params Source: https://letmaik.github.io/rawpy/api/rawpy.Params.html Constructor for the Params class. Initializes postprocessing parameters with optional arguments. If use_camera_wb and use_auto_wb are False and user_wb is None, daylight white balance correction is used. If both use_camera_wb and use_auto_wb are True, use_auto_wb has priority. ```APIDOC ## rawpy.Params ### Description 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. ### Constructor `_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_)` ### 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. ``` -------------------------------- ### postprocess() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Postprocesses the currently loaded RAW image and returns the resulting image as a numpy array. Parameters can be provided as a rawpy.Params object or as keyword arguments. ```APIDOC ## postprocess() ### Description Postprocesses the currently loaded RAW image and returns the resulting image as a numpy array. Parameters can be provided as a rawpy.Params object or as keyword arguments. ### Method postprocess(params: Params | None = None, **kw) -> NDArray[np.uint8] ### Parameters - **params** (rawpy.Params) - Optional - The parameters to use for postprocessing. - **kw** (keyword arguments) - Optional - Alternative way to provide postprocessing parameters. The keywords are used to construct a rawpy.Params instance. If keywords are given, then params must be omitted. ### Returns - **ndarray** of shape (h,w,c) - The postprocessed image. ``` -------------------------------- ### close() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Releases all resources and closes the RAW image. Consider using context managers for the same effect. ```APIDOC ## close() ### Description Releases all resources and closes the RAW image. Consider using context managers for the same effect. ### Method close() ### Parameters None ### Returns None ### Example ``` with rawpy.imread('image.nef') as raw: # work with raw object ``` ``` -------------------------------- ### RawPy.open_buffer Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Opens the given RAW image file-like object. Should be followed by a call to unpack(). This is a low-level method, consider using rawpy.imread() instead. ```APIDOC ## RawPy.open_buffer ### Description Opens the given RAW image file-like object. Should be followed by a call to `unpack()`. This is a low-level method, consider using `rawpy.imread()` instead. ### Method `open_buffer(_self_, _fileobj: BinaryIO_) → None` ### Parameters - **fileobj** (_file_) - Required - The file-like object. ``` -------------------------------- ### RawPy.open_file Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Opens the given RAW image file. Should be followed by a call to unpack(). This is a low-level method, consider using rawpy.imread() instead. ```APIDOC ## RawPy.open_file ### Description Opens the given RAW image file. Should be followed by a call to `unpack()`. This is a low-level method, consider using `rawpy.imread()` instead. ### Method `open_file(_self_, _str path: str_) → None` ### Parameters - **path** (_str_) - Required - The path to the RAW image. ``` -------------------------------- ### ThumbFormat Source: https://letmaik.github.io/rawpy/api/enums.html Enumeration of thumbnail/preview image types. ```APIDOC ## ThumbFormat ### Description Enumeration of thumbnail/preview image types. ### Members - `BITMAP = 2` - `JPEG = 1` ``` -------------------------------- ### DemosaicAlgorithm Source: https://letmaik.github.io/rawpy/api/enums.html Identifiers for demosaic algorithms, with support checking methods. ```APIDOC ## DemosaicAlgorithm ### Description Identifiers for demosaic algorithms. ### Members - `AAHD = 12` - `AFD = 6` - `AHD = 3` - `AMAZE = 10` - `DCB = 4` - `DHT = 11` - `LINEAR = 0` - `LMMSE = 9` - `MODIFIED_AHD = 5` - `PPG = 2` - `VCD = 7` - `VCD_MODIFIED_AHD = 8` - `VNG = 1` ### Methods - `checkSupported(self)` - Like `isSupported` but raises an exception for the False case. - `isSupported` (property) - Return True if the demosaic algorithm is supported, False if it is not, and None if the support status is unknown. The latter is returned if LibRaw < 0.15.4 is used or if it was compiled without cmake. The necessary information is read from the libraw_config.h header which is only written with cmake builds >= 0.15.4. ``` -------------------------------- ### HighlightMode Source: https://letmaik.github.io/rawpy/api/enums.html Enumeration of highlight modes, including a reconstruction method. ```APIDOC ## HighlightMode ### Description Highlight modes. ### Members - `Blend = 2` - `Clip = 0` - `Ignore = 1` - `ReconstructDefault = 5` ### Class Methods - `Reconstruct(level)` - Parameters: `level` (int) - 3 to 9, low numbers favor whites, high numbers favor colors. ``` -------------------------------- ### camera_white_level_per_channel property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Per-channel saturation levels read from raw file metadata, if it exists. Otherwise None. ```APIDOC ## camera_white_level_per_channel property ### Description Per-channel saturation levels read from raw file metadata, if it exists. Otherwise None. ### Type Optional[List[int]] ### Returns - **list** of length 4, or None if metadata missing. ``` -------------------------------- ### color_matrix property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Color matrix, read from file for some cameras, calculated for others. ```APIDOC ## color_matrix property ### Description Color matrix, read from file for some cameras, calculated for others. ### Type NDArray[np.float32] ### Returns - **ndarray** of shape (3,4). ``` -------------------------------- ### ColorSpace Source: https://letmaik.github.io/rawpy/api/enums.html Enumeration of color spaces. ```APIDOC ## ColorSpace ### Description Color spaces. ### Members - `ACES = 6` - `Adobe = 2` - `P3D65 = 7` - `ProPhoto = 4` - `Rec2020 = 8` - `Wide = 3` - `XYZ = 5` - `raw = 0` - `sRGB = 1` ``` -------------------------------- ### RawPy.dcraw_make_mem_thumb Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Return the thumbnail/preview image (see unpack_thumb()) as rawpy.Thumbnail object. For JPEG thumbnails, data is a bytes object and can be written as-is to file. For bitmap thumbnails, data is an ndarray of shape (h,w,c). If no image exists or the format is unsupported, an exception is raised. This is a low-level method, consider using extract_thumb() instead. ```APIDOC ## RawPy.dcraw_make_mem_thumb ### Description Return the thumbnail/preview image (see `unpack_thumb()`) as `rawpy.Thumbnail` object. For JPEG thumbnails, data is a bytes object and can be written as-is to file. For bitmap thumbnails, data is an ndarray of shape (h,w,c). If no image exists or the format is unsupported, an exception is raised. This is a low-level method, consider using `extract_thumb()` instead. ### Method `dcraw_make_mem_thumb(_self_)` ### Return Type `rawpy.Thumbnail` ``` -------------------------------- ### LibRawNonFatalError Source: https://letmaik.github.io/rawpy/api/exceptions.html Base class for non-fatal LibRaw errors. Subtypes include unspecified, file unsupported, request for nonexistent image, out of order call, no thumbnail, unsupported thumbnail, input closed, and not implemented errors. ```APIDOC ## LibRawNonFatalError ### Description `rawpy.LibRawNonFatalError` is a base class for non-fatal LibRaw errors. ### Class `rawpy.LibRawNonFatalError` ### Subtypes - `rawpy.LibRawUnspecifiedError` - `rawpy.LibRawFileUnsupportedError` - `rawpy.LibRawRequestForNonexistentImageError` - `rawpy.LibRawOutOfOrderCallError` - `rawpy.LibRawNoThumbnailError` - `rawpy.LibRawUnsupportedThumbnailError` - `rawpy.LibRawInputClosedError` - `rawpy.LibRawNotImplementedError` ``` -------------------------------- ### NotSupportedError Source: https://letmaik.github.io/rawpy/api/exceptions.html Raised when a feature of LibRaw is used that was not enabled during the LibRaw library build, such as demosaic algorithms from GPL2/GPL3 packs. ```APIDOC ## NotSupportedError ### Description `rawpy.NotSupportedError` is raised if a feature of LibRaw is used that was not enabled during the LibRaw library build, for example demosaic algorithms that are part of the GPL2/GPL3 packs. ### Class `rawpy.NotSupportedError` ### Constructor `_class_ rawpy.NotSupportedError(_self_, _message_, _min_version=None_)` ### Parameters - **message** (str) - Required - The error message. - **min_version** (str) - Optional - The minimum LibRaw version required for the feature. ``` -------------------------------- ### FBDDNoiseReductionMode Source: https://letmaik.github.io/rawpy/api/enums.html Enumeration of FBDD noise reduction modes. ```APIDOC ## FBDDNoiseReductionMode ### Description FBDD noise reduction modes. ### Members - `Full = 2` - `Light = 1` - `Off = 0` ``` -------------------------------- ### camera_whitebalance property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html White balance coefficients (as shot). Either read from file or calculated. ```APIDOC ## camera_whitebalance property ### Description White balance coefficients (as shot). Either read from file or calculated. ### Type List[float] ### Returns - **list** of length 4. ``` -------------------------------- ### daylight_whitebalance property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html White balance coefficients for daylight (daylight balance). Either read from file, or calculated on the basis of file data, or taken from hardcoded constants. ```APIDOC ## daylight_whitebalance property ### Description White balance coefficients for daylight (daylight balance). Either read from file, or calculated on the basis of file data, or taken from hardcoded constants. ### Type List[float] ### Returns - **list** of length 4. ``` -------------------------------- ### num_colors property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Number of colors. Note that e.g. for RGBG this can be 3 or 4, depending on the camera model, as some use two different greens. ```APIDOC ## num_colors property ### Description Number of colors. Note that e.g. for RGBG this can be 3 or 4, depending on the camera model, as some use two different greens. ### Type int ### Returns - **int** - Number of colors. ``` -------------------------------- ### rawpy.ImageSizes Source: https://letmaik.github.io/rawpy/_sources/api/namedtuples.rst.txt Named tuple representing image size information. ```APIDOC ## rawpy.ImageSizes ### Description Named tuple representing image size information. ### Fields - **raw_width** (int) - Width of the raw image. - **raw_height** (int) - Height of the raw image. - **top_margin** (int) - Top margin of the raw image. - **left_margin** (int) - Left margin of the raw image. - **iwidth** (int) - Width of the visible image. - **iheight** (int) - Height of the visible image. - **pixel_aspect** (float) - Pixel aspect ratio. - **flip** (int) - Orientation flip value. ### Usage This named tuple is returned by methods such as `rawpy.RawPy.raw_image_visible` or `rawpy.RawPy.sizes`. ``` -------------------------------- ### RawPy.rgb_xyz_matrix Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Camera RGB - XYZ conversion matrix. This matrix is constant (different for different models). Last row is zero for RGB cameras and non-zero for different color models (CMYG and so on). ```APIDOC ## RawPy.rgb_xyz_matrix ### Description Camera RGB - XYZ conversion matrix. This matrix is constant (different for different models). Last row is zero for RGB cameras and non-zero for different color models (CMYG and so on). ### Property `RawPy.rgb_xyz_matrix: NDArray[np.float32]` ### Return Type ndarray of shape (4,3) ``` -------------------------------- ### LibRawFatalError Source: https://letmaik.github.io/rawpy/api/exceptions.html Base class for fatal LibRaw errors. Subtypes include memory, data, I/O, callback, crop, size, and memory pool overflow errors. ```APIDOC ## LibRawFatalError ### Description `rawpy.LibRawFatalError` is a base class for fatal LibRaw errors. ### Class `rawpy.LibRawFatalError` ### Subtypes - `rawpy.LibRawUnsufficientMemoryError` - `rawpy.LibRawDataError` - `rawpy.LibRawIOError` - `rawpy.LibRawCancelledByCallbackError` - `rawpy.LibRawBadCropError` - `rawpy.LibRawTooBigError` - `rawpy.LibRawMemPoolOverflowError` ``` -------------------------------- ### extract_thumb() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Extracts and returns the thumbnail/preview image (whichever is bigger) of the opened RAW image as a rawpy.Thumbnail object. For JPEG thumbnails, data is a bytes object and can be written as-is to file. For bitmap thumbnails, data is an ndarray of shape (h,w,c). If no image exists or the format is unsupported, an exception is raised. ```APIDOC ## extract_thumb() ### Description Extracts and returns the thumbnail/preview image (whichever is bigger) of the opened RAW image as a rawpy.Thumbnail object. For JPEG thumbnails, data is a bytes object and can be written as-is to file. For bitmap thumbnails, data is an ndarray of shape (h,w,c). If no image exists or the format is unsupported, an exception is raised. ### Method extract_thumb() ### Parameters None ### Returns - **rawpy.Thumbnail** - The thumbnail object. ``` -------------------------------- ### RawPy.dcraw_make_mem_image Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Return the postprocessed image (see dcraw_process()) as numpy array. This is a low-level method, consider using postprocess() instead. ```APIDOC ## RawPy.dcraw_make_mem_image ### Description Return the postprocessed image (see `dcraw_process()`) as numpy array. This is a low-level method, consider using `postprocess()` instead. ### Method `dcraw_make_mem_image(_self_)` ### Return Type ndarray of shape (h,w,c) ``` -------------------------------- ### RawPy.dcraw_process Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Postprocess the currently loaded RAW image. This is a low-level method, consider using postprocess() instead. ```APIDOC ## RawPy.dcraw_process ### Description Postprocess the currently loaded RAW image. This is a low-level method, consider using `postprocess()` instead. ### Method `dcraw_process(_self_, _params: Params | None = None_, _**kw_) → None` ### Parameters - **params** (_rawpy.Params_) - Optional - The parameters to use for postprocessing. - ****kw** - Optional - Alternative way to provide postprocessing parameters. The keywords are used to construct a `rawpy.Params` instance. If keywords are given, then params must be omitted. ``` -------------------------------- ### rawpy.Thumbnail Source: https://letmaik.github.io/rawpy/_sources/api/namedtuples.rst.txt Named tuple representing thumbnail image data. ```APIDOC ## rawpy.Thumbnail ### Description Named tuple representing thumbnail image data. ### Fields - **data** (numpy.ndarray) - Thumbnail image data. - **data_format** (int) - Format of the thumbnail data (e.g., rawpy.ThumbFormat). - **thumb_width** (int) - Width of the thumbnail. - **thumb_height** (int) - Height of the thumbnail. ### Usage This named tuple is returned by `rawpy.RawPy.extract_thumb()`. ``` -------------------------------- ### RawPy.sizes Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Return a rawpy.ImageSizes instance with size information of the RAW image and postprocessed image. ```APIDOC ## RawPy.sizes ### Description Return a `rawpy.ImageSizes` instance with size information of the RAW image and postprocessed image. ### Property `RawPy.sizes: ImageSizes` ``` -------------------------------- ### RawPy.unpack_thumb Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Unpacks/decodes the thumbnail/preview image, whichever is bigger. This is a low-level method, consider using extract_thumb() instead. ```APIDOC ## RawPy.unpack_thumb ### Description Unpacks/decodes the thumbnail/preview image, whichever is bigger. This is a low-level method, consider using `extract_thumb()` instead. ### Method `unpack_thumb(_self_) → None` ``` -------------------------------- ### Lens Source: https://letmaik.github.io/rawpy/api/namedtuples.html Named tuple representing lens information. Create a new instance with the specified fields. ```APIDOC ## Lens ### Description Create new instance of Lens(model, make, min_focal, max_focal) ### Constructor `rawpy.Lens(model, make, min_focal, max_focal)` ### Parameters - **model** (str) - Required - Lens model - **make** (str) - Required - Lens make - **min_focal** (float) - Required - Minimum focal length - **max_focal** (float) - Required - Maximum focal length ``` -------------------------------- ### RawType Source: https://letmaik.github.io/rawpy/api/enums.html Enumeration of RAW image types. ```APIDOC ## RawType ### Description Enumeration of RAW image types. ### Members - `Flat = 0` - `Stack = 1` ``` -------------------------------- ### rawpy.Other Source: https://letmaik.github.io/rawpy/_sources/api/namedtuples.rst.txt Named tuple representing additional image metadata. ```APIDOC ## rawpy.Other ### Description Named tuple representing additional image metadata. ### Fields - **black_level** (int) - Black level of the image. - **white_level** (int) - White level of the image. - **camera_white_level** (int) - Camera white level. - **camera_black_level** (int) - Camera black level. - **rgb_white_level** (int) - RGB white level. - **rgb_black_level** (int) - RGB black level. - **dummy** (int) - Dummy field. ### Usage This named tuple is returned by `rawpy.RawPy.other_metadata`. ``` -------------------------------- ### RawPy class Source: https://letmaik.github.io/rawpy/_sources/api/rawpy.RawPy.rst.txt The RawPy class provides the main interface for reading and processing raw image files. This section documents the public members of the class, excluding the low-level methods listed separately. ```APIDOC ## RawPy class ### Description The RawPy class is the primary interface for working with raw image data. It provides methods for opening, unpacking, and processing raw files, as well as accessing image metadata and pixel data. ### Members - `__init__` - Constructor for the RawPy class. - `open_file` - Opens a raw image file. (Note: This method is listed as a low-level method and is documented separately.) - `open_buffer` - Opens a raw image from a buffer. (Note: This method is listed as a low-level method and is documented separately.) - `unpack` - Unpacks the raw image data. (Note: This method is listed as a low-level method and is documented separately.) - `unpack_thumb` - Unpacks the thumbnail image. (Note: This method is listed as a low-level method and is documented separately.) - `dcraw_process` - Processes the raw image using dcraw. (Note: This method is listed as a low-level method and is documented separately.) - `dcraw_make_mem_image` - Creates a memory image from the processed raw data. (Note: This method is listed as a low-level method and is documented separately.) - `dcraw_make_mem_thumb` - Creates a memory thumbnail from the processed raw data. (Note: This method is listed as a low-level method and is documented separately.) - Other public members as documented by the autoclass directive. ### Notes - The methods `dcraw_make_mem_image`, `dcraw_make_mem_thumb`, `dcraw_process`, `open_file`, `open_buffer`, `unpack`, and `unpack_thumb` are excluded from this section and documented separately as low-level methods. ``` -------------------------------- ### RawPy.unpack Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Unpacks/decodes the opened RAW image. This is a low-level method, consider using rawpy.imread() instead. ```APIDOC ## RawPy.unpack ### Description Unpacks/decodes the opened RAW image. This is a low-level method, consider using `rawpy.imread()` instead. ### Method `unpack(_self_) → None` ``` -------------------------------- ### color_desc property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html String description of colors numbered from 0 to 3 (RGBG, RGBE, GMCY, or GBTG). Note that same letters may not refer strictly to the same color. ```APIDOC ## color_desc property ### Description String description of colors numbered from 0 to 3 (RGBG, RGBE, GMCY, or GBTG). Note that same letters may not refer strictly to the same color. ### Type bytes ### Returns - **bytes** - Color description. ``` -------------------------------- ### Additional low-level methods Source: https://letmaik.github.io/rawpy/_sources/api/rawpy.RawPy.rst.txt These are additional low-level methods of the RawPy class that provide direct access to dcraw functionality and file/buffer operations. ```APIDOC ## Additional low-level methods ### Description These methods are low-level interfaces to the underlying dcraw library and provide direct control over file opening, buffer reading, unpacking, and processing. ### Methods #### `open_file` Opens a raw image file. #### `open_buffer` Opens a raw image from a memory buffer. #### `unpack` Unpacks the raw image data. #### `unpack_thumb` Unpacks the thumbnail image. #### `dcraw_process` Processes the raw image using dcraw. #### `dcraw_make_mem_image` Creates a memory image from the processed raw data. #### `dcraw_make_mem_thumb` Creates a memory thumbnail from the processed raw data. ### Notes - These methods are documented as part of the RawPy class but are considered low-level and may require advanced knowledge of the raw processing pipeline. ``` -------------------------------- ### RawPy.raw_colors_visible Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Like raw_colors but without margin. ```APIDOC ## RawPy.raw_colors_visible ### Description Like raw_colors but without margin. ### Property `RawPy.raw_colors_visible: NDArray[np.uint8]` ### Return Type ndarray of shape (hv,wv) ``` -------------------------------- ### RawPy.raw_image_visible Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Like raw_image but without margin. ```APIDOC ## RawPy.raw_image_visible ### Description Like raw_image but without margin. ### Property `RawPy.raw_image_visible: NDArray[np.uint16]` ### Return Type ndarray of shape (hv,wv[,c]) ``` -------------------------------- ### RawPy.raw_type Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Return the RAW type. ```APIDOC ## RawPy.raw_type ### Description Return the RAW type. ### Property `RawPy.raw_type: RawType` ### Return Type `rawpy.RawType` ``` -------------------------------- ### set_unpack_params() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Sets parameters that affect RAW image unpacking. This should be called after opening a file and before unpacking. This is a low-level method; when using rawpy.imread(), unpack parameters can be provided directly. ```APIDOC ## set_unpack_params() ### Description Sets parameters that affect RAW image unpacking. This should be called after opening a file and before unpacking. This is a low-level method; when using rawpy.imread(), unpack parameters can be provided directly. ### Method set_unpack_params(shot_select: int = 0) -> None ### Parameters - **shot_select** (int) - Optional - Select which image to extract from RAW files that contain multiple images (e.g., Dual Pixel RAW). Default is 0 for the first/main image. ### Returns None ``` -------------------------------- ### other property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Other metadata. ```APIDOC ## other property ### Description Other metadata. ### Type Other ### Returns - **Other** - Other object. ``` -------------------------------- ### RawPy.tone_curve Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Camera tone curve, read from file for Nikon, Sony and some other cameras. ```APIDOC ## RawPy.tone_curve ### Description Camera tone curve, read from file for Nikon, Sony and some other cameras. ### Property `RawPy.tone_curve: NDArray[np.uint16]` ### Return Type ndarray of length 65536 ``` -------------------------------- ### rawpy.Lens Source: https://letmaik.github.io/rawpy/_sources/api/namedtuples.rst.txt Named tuple representing lens information. ```APIDOC ## rawpy.Lens ### Description Named tuple representing lens information. ### Fields - **min_focal** (float) - Minimum focal length. - **max_focal** (float) - Maximum focal length. - **max_aperture** (float) - Maximum aperture. - **max_aperture_at_min_focal** (float) - Maximum aperture at minimum focal length. - **max_aperture_at_max_focal** (float) - Maximum aperture at maximum focal length. ### Usage This named tuple is returned by `rawpy.RawPy.lens_info`. ``` -------------------------------- ### black_level_per_channel property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Per-channel black level correction. ```APIDOC ## black_level_per_channel property ### Description Per-channel black level correction. ### Type List[int] ### Returns - **list** of length 4. ``` -------------------------------- ### lens property Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Lens information. ```APIDOC ## lens property ### Description Lens information. ### Type Lens ### Returns - **Lens** - Lens object. ``` -------------------------------- ### RawPy.raw_pattern Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html The smallest possible Bayer pattern of this image. ```APIDOC ## RawPy.raw_pattern ### Description The smallest possible Bayer pattern of this image. ### Property `RawPy.raw_pattern: Optional[NDArray[np.uint8]]` ### Return Type ndarray, or None if not a flat RAW image ``` -------------------------------- ### rawpy.enhance.find_bad_pixels() Source: https://letmaik.github.io/rawpy/api/rawpy.enhance.html Finds and returns coordinates of hot/dead pixels in the given RAW images. The probability of correct detection increases with more input images, which should be taken around the same time and with movement between shots. ```APIDOC ## rawpy.enhance.find_bad_pixels() ### Description Find and return coordinates of hot/dead pixels in the given RAW images. The probability that a detected bad pixel is really a bad pixel gets higher the more input images are given. The images should be taken around the same time, that is, each image must contain the same bad pixels. Also, there should be movement between the images to avoid the false detection of bad pixels in non-moving high-contrast areas. ### Method Function call ### Signature rawpy.enhance.find_bad_pixels(paths, find_hot=True, find_dead=True, confirm_ratio=0.9) ### Parameters - **paths** (iterable of str) - Required - paths to RAW images shot with the same camera - **find_hot** (bool) - Optional - whether to find hot pixels (default: True) - **find_dead** (bool) - Optional - whether to find dead pixels (default: True) - **confirm_ratio** (float) - Optional - ratio of how many out of all given images must contain a bad pixel to confirm it as such (default: 0.9) ### Returns - **ndarray** of shape (n,2) with y,x coordinates relative to visible RAW size - coordinates of confirmed bad pixels ### Return Type ndarray of shape (n,2) with y,x coordinates relative to visible RAW size ``` -------------------------------- ### raw_value() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Returns the RAW value at the given position relative to the full RAW image. Only usable for flat RAW images (see raw_type property). ```APIDOC ## raw_value() ### Description Returns the RAW value at the given position relative to the full RAW image. Only usable for flat RAW images (see raw_type property). ### Method raw_value(row: int, column: int) -> ushort ### Parameters - **row** (int) - Required - Row coordinate. - **column** (int) - Required - Column coordinate. ### Returns - **ushort** - RAW value. ``` -------------------------------- ### raw_color() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Returns the color index for the given coordinates relative to the full RAW size. Only usable for flat RAW images (see raw_type property). ```APIDOC ## raw_color() ### Description Returns the color index for the given coordinates relative to the full RAW size. Only usable for flat RAW images (see raw_type property). ### Method raw_color(row: int, column: int) -> int ### Parameters - **row** (int) - Required - Row coordinate. - **column** (int) - Required - Column coordinate. ### Returns - **int** - Color index. ``` -------------------------------- ### LibRawError Source: https://letmaik.github.io/rawpy/api/exceptions.html Base type for all LibRaw errors. Can be used to catch any LibRaw error. ```APIDOC ## LibRawError ### Description `rawpy.LibRawError` is the base type of `rawpy.LibRawFatalError` and `rawpy.LibRawNonFatalError` and can be used to catch any LibRaw errors. ### Class `rawpy.LibRawError` ``` -------------------------------- ### RawPy.raw_image Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html View of RAW image. Includes margin. For Bayer images, a 2D ndarray is returned. For Foveon and other RGB-type images, a 3D ndarray is returned. Modifying the returned array directly influences the result of calling postprocess(). ```APIDOC ## RawPy.raw_image ### Description View of RAW image. Includes margin. For Bayer images, a 2D ndarray is returned. For Foveon and other RGB-type images, a 3D ndarray is returned. Note that there may be 4 color channels, where the 4th channel can be blank (zeros). Modifying the returned array directly influences the result of calling `postprocess()`. ### Warning The returned numpy array can only be accessed while this RawPy instance is not closed yet, that is, within a `with` block or before calling `close()`. If you need to work on the array after closing the RawPy instance, make sure to create a copy of it with `raw_image = raw.raw_image.copy()`. ### Property `RawPy.raw_image: NDArray[np.uint16]` ### Return Type ndarray of shape (h,w[,c]) ``` -------------------------------- ### rawpy.enhance.repair_bad_pixels() Source: https://letmaik.github.io/rawpy/api/rawpy.enhance.html Repairs bad pixels in the given RAW image. The function works in-place on the RAW image data and must be called before postprocessing the image. ```APIDOC ## rawpy.enhance.repair_bad_pixels() ### Description Repair bad pixels in the given RAW image. Note that the function works in-place on the RAW image data. It has to be called before postprocessing the image. ### Method Function call ### Signature rawpy.enhance.repair_bad_pixels(raw, coords, method='median') ### Parameters - **raw** (rawpy.RawPy) - Required - the RAW image to repair - **coords** (array-like) - Required - coordinates of bad pixels to repair, array of shape (n,2) with y,x coordinates relative to visible RAW size - **method** (str) - Optional - currently only 'median' is supported (default: 'median') ### Returns None (works in-place) ``` -------------------------------- ### RawPy.raw_colors Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html An array of color indices for each pixel in the RAW image. Equivalent to calling raw_color(y,x) for each pixel. Only usable for flat RAW images. ```APIDOC ## RawPy.raw_colors ### Description An array of color indices for each pixel in the RAW image. Equivalent to calling raw_color(y,x) for each pixel. Only usable for flat RAW images (see raw_type property). ### Property `RawPy.raw_colors: NDArray[np.uint8]` ### Return Type ndarray of shape (h,w) ``` -------------------------------- ### rawpy.enhance.save_dcraw_bad_pixels() Source: https://letmaik.github.io/rawpy/api/rawpy.enhance.html Saves the given bad pixel coordinates in dcraw file format. Note that timestamps cannot be set and will be written as zero. ```APIDOC ## rawpy.enhance.save_dcraw_bad_pixels() ### Description Save the given bad pixel coordinates in dcraw file format. Note that timestamps cannot be set and will be written as zero. ### Method Function call ### Signature rawpy.enhance.save_dcraw_bad_pixels(path, bad_pixels) ### Parameters - **path** (str) - Required - path of the badpixels file that will be written - **bad_pixels** (array-like) - Required - array of shape (n,2) with y,x coordinates relative to visible image area ### Returns None ``` -------------------------------- ### raw_value_visible() Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Returns the RAW value at the given position relative to the visible area of the image. Only usable for flat RAW images (see raw_type property). ```APIDOC ## raw_value_visible() ### Description Returns the RAW value at the given position relative to the visible area of the image. Only usable for flat RAW images (see raw_type property). ### Method raw_value_visible(row: int, column: int) -> ushort ### Parameters - **row** (int) - Required - Row coordinate. - **column** (int) - Required - Column coordinate. ### Returns - **ushort** - RAW value. ``` -------------------------------- ### RawPy.white_level Source: https://letmaik.github.io/rawpy/api/rawpy.RawPy.html Level at which the raw pixel value is considered to be saturated. ```APIDOC ## RawPy.white_level ### Description Level at which the raw pixel value is considered to be saturated. ### Property `RawPy.white_level: int` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.