All Projects → pedrocr → Rawloader

pedrocr / Rawloader

Licence: lgpl-2.1
rust library to extract the raw data and some metadata from digital camera images

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rawloader

Tinyrenderer
A brief computer graphics / rendering course
Stars: ✭ 11,776 (+7596.73%)
Mutual labels:  images
Phpasn1
A PHP library to encode and decode arbitrary ASN.1 structures using ITU-T X.690 encoding rules.
Stars: ✭ 136 (-11.11%)
Mutual labels:  decoding
Ffmpeg Video Player
An FFmpeg and SDL Tutorial.
Stars: ✭ 149 (-2.61%)
Mutual labels:  decoding
Fit
A Go package for decoding and encoding Garmin FIT files
Stars: ✭ 128 (-16.34%)
Mutual labels:  decoding
Picpic
A awesome image host service driven by github pages and github actions.
Stars: ✭ 135 (-11.76%)
Mutual labels:  images
Crypto Rnn
Learning the Enigma with Recurrent Neural Networks
Stars: ✭ 139 (-9.15%)
Mutual labels:  decoding
Lilliput
Resize images and animated GIFs in Go
Stars: ✭ 1,690 (+1004.58%)
Mutual labels:  images
Ipyplot
IPyPlot is a small python package offering fast and efficient plotting of images inside Python Notebooks. It's using IPython with HTML for faster, richer and more interactive way of displaying big numbers of images.
Stars: ✭ 152 (-0.65%)
Mutual labels:  images
Pinry
The open-source core of Pinry, a tiling image board system for people who want to save, tag, and share images, videos and webpages in an easy to skim through format.
Stars: ✭ 1,819 (+1088.89%)
Mutual labels:  images
Imgpush
Minimalist Self-hosted Image Service for user submitted images in your app
Stars: ✭ 144 (-5.88%)
Mutual labels:  images
Stegbrute
Fast Steganography bruteforce tool written in Rust useful for CTF's
Stars: ✭ 134 (-12.42%)
Mutual labels:  images
Imgaug
Image augmentation for machine learning experiments.
Stars: ✭ 12,107 (+7813.07%)
Mutual labels:  images
Instagramdownloader
Firefox and Chrome Extention which creates an download button for instagram images and videos and videos
Stars: ✭ 144 (-5.88%)
Mutual labels:  images
Lerc
Limited Error Raster Compression
Stars: ✭ 126 (-17.65%)
Mutual labels:  decoding
Idenprof
IdenProf dataset is a collection of images of identifiable professionals. It is been collected to enable the development of AI systems that can serve by identifying people and the nature of their job by simply looking at an image, just like humans can do.
Stars: ✭ 149 (-2.61%)
Mutual labels:  images
Codability
Useful helpers for working with Codable types in Swift
Stars: ✭ 125 (-18.3%)
Mutual labels:  decoding
Datasets
🎁 3,000,000+ Unsplash images made available for research and machine learning
Stars: ✭ 1,805 (+1079.74%)
Mutual labels:  images
React Intense
A React component for viewing large images up close 🔍
Stars: ✭ 152 (-0.65%)
Mutual labels:  images
Xcassetpacker
A command line tool for converting a folder of images into an .xcasset package for Xcode
Stars: ✭ 150 (-1.96%)
Mutual labels:  images
Himawari.js
Download real-time images of Earth from the Himawari-8 satellite
Stars: ✭ 1,763 (+1052.29%)
Mutual labels:  images

rawloader

Build Status Crates.io

This is a rust 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:

  • Identification of the camera that produced the image (both the EXIF name and a cleaned up name)
  • The raw pixels themselves, exactly as encoded by the camera
  • The number of pixels to crop on the top, right, bottom, left of the image to only use the actual image area
  • The black and white points of each of the color channels
  • The multipliers to apply to the color channels for the white balance
  • A conversion matrix between the camera color space and XYZ
  • The description of the bayer pattern itself so you'll know which pixels are which color

Current State

The library is still a work in process with the following formats already implemented:

  • Minolta MRW
  • Sony ARW, SRF and SR2
  • Mamiya MEF
  • Olympus ORF
  • Samsung SRW
  • Epson ERF
  • Kodak KDC
  • Kodak DCS
  • Panasonic RW2 (also used by Leica)
  • Fuji RAF
  • Kodak DCR
  • Adobe DNG (the "good parts"1)
  • Pentax PEF
  • Canon CRW
  • "Naked" files2
  • Leaf IIQ
  • Hasselblad 3FR
  • Nikon NRW
  • Nikon NEF
  • Leaf MOS
  • Canon CR2
  • ARRI's ARI

1 DNG is a 101 page overambitious spec that tries to be an interchange format for processed images, complete with image transformation operations. We just implement enough of the spec so that actual raw files from DNG producing cameras or the Adobe DNG converter can be read.

2 Files that are just the raw data itself with no metadata whatsoever. The most common of these are the files generated by the Canon CHDK hacked firmware. Later versions produced actual DNG files but the first ones just did a dump of the raw data next to the JPG and assumed the user would use the JPG for the metadata. We match them by the filesize itself which means that if you feed rawloader with a file that has the exact same bytecount as these files you'll get a nice garbage output...

Usage

Here's a simple sample program that uses this library:

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 = rawloader::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 rawloader::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");
  }
}

Contributing

Bug reports and pull requests welcome at https://github.com/pedrocr/rawloader

Meet us at #chimper on irc.freenode.net if you need to discuss a feature or issue in detail or even just for general chat.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].