#camera-raw #camera-image #raw-image #camera

bin+lib rawler

A library to extract images and metadata from camera raw formats

3 unstable releases

Uses new Rust 2024

0.7.1 Oct 3, 2025
0.7.0 Jun 7, 2025
0.6.0 Jan 6, 2024

#149 in Images

Download history 1518/week @ 2025-10-17 810/week @ 2025-10-24 410/week @ 2025-10-31 469/week @ 2025-11-07 724/week @ 2025-11-14 423/week @ 2025-11-21 827/week @ 2025-11-28 571/week @ 2025-12-05 472/week @ 2025-12-12 927/week @ 2025-12-19 943/week @ 2025-12-26 902/week @ 2026-01-02 594/week @ 2026-01-09 981/week @ 2026-01-16 1371/week @ 2026-01-23 1738/week @ 2026-01-30

4,726 downloads per month
Used in 5 crates (2 directly)

LGPL-2.1

1MB
28K SLoC

Library to extract the raw data and some metadata from digital camera images. Given an image in a supported format and camera you will be able to get everything needed to process the image

Example

use std::env;
use std::fs::File;
use std::io::prelude::*;
use std::io::BufWriter;

fn main() {
  let args: Vec<_> = env::args().collect();
  if args.len() != 2 {
    println!("Usage: {} <file>", args[0]);
    std::process::exit(2);
  }
  let file = &args[1];
  let image = rawler::decode_file(file).unwrap();

  // Write out the image as a grayscale PPM
  let mut f = BufWriter::new(File::create(format!("{}.ppm",file)).unwrap());
  let preamble = format!("P6 {} {} {}\n", image.width, image.height, 65535).into_bytes();
  f.write_all(&preamble).unwrap();
  if let rawler::RawImageData::Integer(data) = image.data {
    for pix in data {
      // Do an extremely crude "demosaic" by setting R=G=B
      let pixhigh = (pix>>8) as u8;
      let pixlow  = (pix&0x0f) as u8;
      f.write_all(&[pixhigh, pixlow, pixhigh, pixlow, pixhigh, pixlow]).unwrap()
    }
  } else {
    eprintln!("Don't know how to process non-integer raw files");
  }
}

Rawler

Digital camera raw format library

What is Rawler?

Rawler parses raw file formats and provides access to the pixels and all metadata.

Why is it named rawler?

It's a (c)rawler, just for raw file structures.

Why another raw library?

  • There are libraries dealing with metadata (exiv2) and for pixels (rawspeed, libraw), but not for both. Each library ships their own file structure parsers.
  • rawloader, which is basically the fundament of this library, is a pretty good library, but lacks of support for metadata.
  • For fun.

Dependencies

~30MB
~488K SLoC