#raw #photography #imaging #encoding #camera-raw

app rawbit

A camera RAW image preprocessor and importer

10 releases

new 0.1.12 Dec 21, 2024
0.1.11 Dec 16, 2024
0.1.3 Nov 22, 2024

#30 in Images

Download history 327/week @ 2024-11-17 33/week @ 2024-11-24 256/week @ 2024-12-01 143/week @ 2024-12-08 617/week @ 2024-12-15

1,074 downloads per month

MIT and LGPL-2.1

47KB
1K SLoC


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 individual 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

Pre-built binaries

Pre-built binaries releases are available for download from the latest GitHub release.

I plan on making binary releases available for all major platforms via package managers. In the meantime, there are AUR & crates.io packages available:

Arch Linux

You can install rawbit with your preferred AUR helper. Example:

paru -S rawbit

Crates.io

  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

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
  -e, --embed-raw
          embed the original raw image in the converted DNG
          NOTE: conversion may take considerably longer
  -f, --force
          overwrite existing files, if they exist
  -r, --recurse
          ingest images from subdirectories as well, preserving directory structure in the output
      --no-preview
          don't embed image preview in output DNG
      --no-thumbnail
          don't embed image thumbnail in output DNG
      --dry-run
          only print run information, don't perform conversions or write any data.
  -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, --verbose...
          increase log verbosity; specify multiple times to increase verbosity
  -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 and robust, but my main motivation for developing rawbit was to enable a more flexible batch DNG conversion/import workflow with entirely free (as in freedom) software enabling it.

This project utilizes the same library that powers DNGLab, so I owe a huge thanks to the DNGLab/Rawler 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/tokio: For making fearless concurrency a peice of cake
Adam Perkowski: Contributing CI and package manager support

Dependencies

~20–30MB
~425K SLoC