Skip to content

cartercanedy/rawbit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


rawbit

A camera RAW image preprocessor and importer written in Rust.

Rawbit processes raw image files by converting them to the DNG format in parallel, while offering the ability to manipulate metadata and customize file name formatting.

Features

  • RAW Image Conversion: Converts camera RAW files to DNG format.
  • Flexible Input/Output:
    • Process single files or entire directories.
    • Define output directories with optional overwrite support.
  • Custom Filename Formatting: Supports user-defined naming conventions for output files.
  • Metadata Handling: Supports EXIF metadata manipulation
  • Multi-Threaded Processing: Leverages multiple CPU cores for parallel image processing.

all written in Rust, btw...

Installation

Installation

I plan on making binary releases available for all major platforms via package managers, but in the meantime, you'll need to have the Rust toolchain installed:

  1. Install Rust and ensure cargo is available.
  2. Install via cargo:
    cargo install rawbit

Examples

Convert a single file

rawbit --out-dir "./dng" --format "%Y-%m-%d_%H-%M-%S_{image.original_filename}" ./raw/ABC1234.ARW

# or 

rawbit -o"./dng" -F"%Y-%m-%d_%H-%M-%S_{image.original_filename}" ./raw/ABC1234.ARW

Convert an entire directory

rawbit --in-dir "./raw" --out-dir "./dng" --format "%Y-%m-%d_{camera.model}_{lens.model}_{image.original_filename}"

# or

rawbit -i"./raw" -o"./dng" -F"%Y-%m-%d_{camera.model}_{lens.model}_{image.original_filename}"

Usage

rawbit [OPTIONS] --out-dir <DIR> <--in-dir <DIR>|FILES>

Arguments: [FILES]...     individual files to convert

Options: -i, --in-dir <DIR>     directory containing raw files to convert -o, --out-dir <DIR>     directory to write converted DNGs -F, --format <FORMAT>     filename format of converted DNGs; see https://docs.rs/rawbit for info on syntax -a, --artist <ARTIST>     value of the "artist" field in converted DNGs --embed-original     embed the original raw image in the converted DNG     NOTE: conversion may take considerably longer -j, --n-threads <N>     number of threads to use while processing input images, defaults to number of CPUs -q, --quiet     quiet output, only emit critical errors -v...     increase log verbosity; specify multiple times to increase verbosity -f, --force     overwrite existing files, if they exist -h, --help     Print help -V, --version     Print version

Filename formatting

This is the distinguishing feature of rawbit.

Date/time interpolation

You can insert the date-time information read from the RAW image's metadata using syntax similar to libc's strftime. More information can be found here

Metadata interpolation

Similar to the date/time interpolation, some well-known names in between squirly braces (i.e. "{...}") expands into image-specific EXIF metadata in the filename:

Variable Description Example
camera.make Camera make
camera.model Camera model
camera.shutter_speed Shutter speed used to take the image
camera.iso Sensor sensitivity (ISO) used to take the image
lens.make Lens make
lens.model Lens model
lens.f_stop Lens aperture F stop value use to take the image
image.original_filename Image's original filename.
Automatically inserted if not specified in the original format string

Note:
More metadata fields are a WIP, more to come soon...

Why not use dnglab?

dnglab convert is extremely versatile, but the inability to format the resulting converted DNG filenames is a dealbreaker coming from using Lightroom RAW import tooling.

rawbit's superpower is the ability to inspect the metadata of the file being converted into the filename of the converted DNG, making batch image processing that much easier to manage without expensive and proprietary software.

rawbit actually uses the same RAW image processing library that was created by the maker of dnglab, named rawler.
I owe a huge thanks to the DNGLab team for their awesome work that made this project possible.

Special thanks

DNGLab/Rawler: Rust-native RAW image manipulation tools from the ground-up
rayon: For making fearless concurrency a peice of cake
Adam Perkowski: Contributing CI and package manager support