Expand description
§rawshift-image
Still-image support for rawshift: a high-performance RAW image processing library with support for multiple camera formats and a full processing pipeline, plus standard compressed-format decode/encode.
This crate is normally consumed through the rawshift facade crate
(enable its image feature). Depend on rawshift-image directly when you
need per-format Cargo feature control.
§Supported Formats
§RAW Formats (full pipeline)
- Sony ARW (v1–v5)
- Adobe DNG (v1.7, including Apple ProRAW)
- Canon CR2
- Canon CR3 (metadata + format detection; pixel decode pending CRX codec)
- Nikon NEF
- Fujifilm RAF
§Standard Formats (direct RGB decode)
- GIF, JPEG, PNG, WebP, JPEG XL, TIFF
- SVG (requires
svgfeature) - AVIF decode + encode (requires
aviffeature) - HEIC decode (requires
heicfeature; via libheif) - APV (detection only; no Rust decoder exists yet)
§Quick Start
ⓘ
// Requires features = ["experimental"]
use rawshift_image::formats::RawFile;
use std::fs::File;
let file = File::open("image.arw").expect("Failed to open file");
let raw = RawFile::open(file).expect("Failed to parse RAW file");
let metadata = raw.metadata();
println!(
"Camera: {} {}",
metadata.camera.make,
metadata.camera.model
);§Processing Pipeline
Raw images go through these steps:
- Format decoding (ARW, DNG, CR2, NEF, RAF)
- Black level subtraction
- White balance
- Demosaicing (AMaZE, RCD, LMMSE, Markesteijn)
- Color matrix application
- Tone mapping / gamma
§Feature Flags
Cargo features are organised in five tiers, high-level to low-level. Each tier is defined in terms of the tier below; only tier-4 features (and RAW tier-3 features) pull in an external crate.
- Bundles —
default,full,experimental,raw-stabilizing,raw-incomplete. - Formats —
jpeg,png,webp,jxl,avif,dng,gif,tiff,heic,svg,arw,cr2,cr3,crw,nef,raf(decode + encode for that format). - Directions —
jpeg-decode,jpeg-encode,arw-decode, … For compressed formats a direction feature aliases the default implementation; RAW formats have a single in-repo implementation. - Implementations — compressed formats only, named
format-direction-impl(e.g.jpeg-decode-zune). Multiple may be enabled at once; the active backend is chosen viaformats::DecodeOptionsandformats::export::EncodeOptions. - Infrastructure —
tiff-parser,serde,heic-vendored.
See the “Feature Flags” section of the README for the full hierarchy.
Modules§
- core
- Core types and traits for image processing.
- data
- Data constants for image processing.
- error
- Error types for RAW image processing.
- formats
- RAW format decoders.
- prelude
- Convenience re-exports of the most commonly used types and functions.
- processing
- Pixel processing and color space conversion primitives
- tiff
- Low-level TIFF engine.
- transforms
- Image transformation and processing pipeline.