Skip to content
karasibillePublic

About

Fast JPEG+RAW photo culling in the terminal, with RawTherapee integration and glitch effects. Written in Rust.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

108 Commits

Folders and files

Repository files navigation

corrode

Fast JPEG+RAW photo culling in the terminal, with RawTherapee integration and glitch effects. Written in Rust.

Status: early development. Culling, sorting a selection into groups of similar shots and applying a preset in bulk work; the effects are still a library, without an interface yet.

corrode is for photographers who shoot a lot. It helps to go through hundreds of photos of a shoot and keep the good ones, puts the photos that look alike in folders, and gives a whole folder the same retouching in one go. It can also turn a photo into something else on purpose, with effects that imitate the faults of old film, compressed files and screens, as in the pictures below.

Gallery

Every picture is the same photo, cropped to a square, with one effect; open recipe and options under it for the recipe that made it and the parameters of the effect. What each effect does is explained in the effects page, and sh docs/examples/generate.sh makes the pictures again. Photo © Káranarchist (@karanarchist on Instagram).


generation loss
recipe and options
loss

generations=30 times the picture is saved as a JPEG and read back
quality=25 JPEG quality of each generation, 1 to 100; the lower, the faster it wears
shift=1,0 dx,dy: pixels the picture moves before each generation, so that the blocks do not line up

databending
recipe and options
bend

quality=75 JPEG quality before the bytes are bent; the lower, the larger the blocks
hits=8 how many bytes of the file are changed

pixel sorting
recipe and options
sort

direction=horizontal horizontal or vertical
low=40 darkest brightness that is sorted, 0 to 255
high=220 brightest brightness that is sorted, 0 to 255
reverse=false sort from bright to dark instead

slice shift
recipe and options
slice

slices=12 how many slices are pushed aside
shift=120 how far a slice can go, in pixels
height=8,120 min,max height of a slice, in pixels
split=false push red, green and blue by different amounts, so that they come apart
invert=false invert the colours of one slice in three

pixel stretch
recipe and options
stretch

bands=6 how many lines are stretched
length=20,200 min,max how far a line is stretched, in pixels
direction=horizontal horizontal (rows) or vertical (columns)

channel split
recipe and options
split

red=-6,0 dx,dy pixels the red channel moves
green=0,0 dx,dy pixels the green channel moves
blue=6,0 dx,dy pixels the blue channel moves

dither, error diffusion
recipe and options
dither

method=diffusion diffusion (scattered dots) or bayer (regular pattern)
size=2 size of a dot, in pixels
mid=128 brightness, 0 to 255, that comes out mid-grey

dither, ordered matrix
recipe and options
dither method=bayer

method=diffusion diffusion (scattered dots) or bayer (regular pattern)
size=2 size of a dot, in pixels
mid=128 brightness, 0 to 255, that comes out mid-grey

duotone
recipe and options
duotone

dark=000000 ink of the shadows; a colour is hex, a name or a hue
light=ff4fa3 ink of the lights

tritone
recipe and options
tritone

dark=14052b ink of the shadows
mid=e0204f ink of the mid tones
light=ffd9a0 ink of the lights
mix=100 how much of the print shows over the picture, 0 to 100

scanlines
recipe and options
scanlines

period=4 rows from one line to the next
thickness=1 rows a line is thick
strength=60 how dark the lines are, 0 to 100

drag, a flash over a slow shutter
recipe and options
drag

kind=motion motion (along a line), zoom (from the centre) or arc (round the centre)
length=60 how far the smear goes, in pixels
angle=0 direction of a motion smear in degrees, 0 to the right, 90 down
center=50,50 x,y centre of a zoom or arc smear, in percent of the width and height
mix=70 how much of the smear shows, 0 to 100
blend=lighten lighten, screen or normal

drag, zooming
recipe and options
drag kind=zoom

kind=motion motion (along a line), zoom (from the centre) or arc (round the centre)
length=60 how far the smear goes, in pixels
angle=0 direction of a motion smear in degrees, 0 to the right, 90 down
center=50,50 x,y centre of a zoom or arc smear, in percent of the width and height
mix=70 how much of the smear shows, 0 to 100
blend=lighten lighten, screen or normal

chromatic aberration
recipe and options
aberration

amount=0.006 how much larger the red is drawn than the green, and the blue smaller; 0.01 is already strong

film grain
recipe and options
grain

strength=30 how strong the grain is, 0 to 100
size=2 size of a grain, in pixels
color=false grain that colours the picture, or only lightens and darkens it

faded print
recipe and options
fade

lift=12 how far the blacks are lifted, 0 to 100
saturation=80 100 leaves the colour, 0 takes it out, 200 doubles it
tint=ff8c42 colour the picture leans towards
tint_amount=10 how much it leans, 0 to 100

vignette
recipe and options
vignette

strength=50 how dark the corners get, 0 to 100
start=40 where the darkening starts, 0 to 100 of the way from the centre to the corners

light leak
recipe and options
leak

color=ff963c colour of the light
strength=70 how strong the leak is, 0 to 100
size=50 how far it reaches, 0 to 100 of the width
edge=random random (a point on an edge, from the seed), left, right, top or bottom (the whole side)
spread=0 how far the hue wanders round the colour, in degrees either way
wobble=0 how uneven the glow is, in reach and strength, 0 to 100

light streaks
recipe and options
streaks count=1 position=0 wobble=15

color=ff3a10 colour of the streaks where they are half bright
strength=85 how strong the streaks are, 0 to 100
count=3 how many streaks, 1 to 8
width=28 how wide a streak is, 0 to 100 of the width
spread=20 how far the hue goes either way between the dim edge and the bright core, in degrees
wobble=0 how much the streaks wander and fade from top to bottom, 0 to 100
softness=40 how soft the edge is where the light stops short, 0 for a cut, 0 to 100
position=random random, or where the first streak is, 0 to 100 of the width (the others stay drawn)

bloom
recipe and options
bloom

threshold=200 brightness above which a light glows, 0 to 255
radius=30 how far the glow spreads, in pixels
strength=60 how bright the glow is, 0 to 100

liquid distortion
recipe and options
liquid

amplitude=40 how far a pixel can be pushed, in pixels
scale=150 size of the waves, in pixels
octaves=2 layers of finer waves; 1 is smooth, 3 is choppy
drift=0 how far the waves have drifted, in pixels; moving it makes the water flow

false colour (red and blue swapped)
recipe and options
falsecolor

order=bgr where each channel comes from: rgb, bgr, gbr…
invert=none channels turned negative: r, g, b, rb… or none
rotate=0 turn the hues by this many degrees, -180 to 180
saturation=100 0 takes the colour out, 100 leaves it, 200 doubles it, up to 400
only=none move only this hue (a name, degrees or hex); none moves all
width=30 degrees either side of only that are moved whole
soft=30 degrees over which the move fades
smooth=1 how soft the edge of a zone is, in percent of the long side of the picture; the zone is judged on a blurred small copy, so the edge is not a line and a speck of another colour inside it is moved with the rest; 0 judges each pixel alone
mix=100 how much of the result shows over the picture, 0 to 100

false colour, hues turned
recipe and options
falsecolor order=rgb rotate=120

order=bgr where each channel comes from: rgb, bgr, gbr…
invert=none channels turned negative: r, g, b, rb… or none
rotate=0 turn the hues by this many degrees, -180 to 180
saturation=100 0 takes the colour out, 100 leaves it, 200 doubles it, up to 400
only=none move only this hue (a name, degrees or hex); none moves all
width=30 degrees either side of only that are moved whole
soft=30 degrees over which the move fades
smooth=1 how soft the edge of a zone is, in percent of the long side of the picture; the zone is judged on a blurred small copy, so the edge is not a line and a speck of another colour inside it is moved with the rest; 0 judges each pixel alone
mix=100 how much of the result shows over the picture, 0 to 100

one point colour
recipe and options
onepoint hue=80deg width=35 soft=30 rest=0

hue=0deg the colour kept: a name, degrees or hex
width=30 degrees either side of it that are kept whole
soft=30 degrees over which the colour fades to grey
rest=0 how much colour everything else keeps, 0 to 100
at=none x,y in percent: take the hue from this point of the picture; none uses hue
smooth=1 how soft the edge of the kept zone is, in percent of the long side of the picture; a speck of another colour inside it is kept with the rest; 0 judges each pixel alone

false colour, only the sky
recipe and options
falsecolor order=rgb rotate=45 saturation=200 only=blue width=25 soft=25

order=bgr where each channel comes from: rgb, bgr, gbr…
invert=none channels turned negative: r, g, b, rb… or none
rotate=0 turn the hues by this many degrees, -180 to 180
saturation=100 0 takes the colour out, 100 leaves it, 200 doubles it, up to 400
only=none move only this hue (a name, degrees or hex); none moves all
width=30 degrees either side of only that are moved whole
soft=30 degrees over which the move fades
smooth=1 how soft the edge of a zone is, in percent of the long side of the picture; the zone is judged on a blurred small copy, so the edge is not a line and a speck of another colour inside it is moved with the rest; 0 judges each pixel alone
mix=100 how much of the result shows over the picture, 0 to 100

remap, a hue sent elsewhere
recipe and options
remap map=blue:orange,green:red saturation=130

map=none pairs from:to such as blue:orange,green:red, each hue sent to another; up to 8
width=25 degrees either side of a hue that are moved whole
soft=25 degrees over which the move fades
smooth=1 how soft the edge of a zone is, in percent of the long side of the picture; a speck of another colour inside a zone is moved with the rest; 0 judges each pixel alone
saturation=100 strength of the moved colours, 0 to 400; 100 leaves it
mix=100 how much of the result shows over the picture, 0 to 100

spin, a turning smear
recipe and options
spin angle=14

angle=10 how far it turns, in degrees
center=50,50 x,y centre of the turn, in percent of the width and height
steps=0 positions blended; 0 takes as many as each pixel needs, 5 gives separate ghosts
mix=100 how much of the smear shows over the sharp picture, 0 to 100

spin, a few ghosts
recipe and options
spin angle=24 steps=5 center=30,60

angle=10 how far it turns, in degrees
center=50,50 x,y centre of the turn, in percent of the width and height
steps=0 positions blended; 0 takes as many as each pixel needs, 5 gives separate ghosts
mix=100 how much of the smear shows over the sharp picture, 0 to 100

three effects in a row
recipe and options
sort low=40 high=220 + slice slices=12 split=true + grain

effects joined by + run in order, each with its own options

prism, light split into a spectrum
recipe and options
prism kind=radial center=100,100 position=15 size=80 hue=260 range=-350 white=40 strength=70

kind=linear linear (straight bands) or radial (rings round a centre)
angle=0 direction the spectrum runs along for straight bands, in degrees, 0 to the right, 90 down
center=50,100 x,y centre of the rings, in percent of the width and height
position=30 where the spectrum starts, 0 to 100 of the width
size=40 how wide the whole spectrum is, 0 to 100 of the width
hue=220 hue it starts with, in degrees: 0 red, 120 green, 240 blue
range=-200 degrees of hue it goes through, negative the other way round
strength=80 how strong the light is, 0 to 100
white=35 how much of the core turns towards white, 0 to 100
wobble=0 how uneven it is: bending and fading from place to place, 0 to 100

An animation mixing five effects: the colours turn from green to violet while slices of the picture are pushed aside, the red and blue edges grow, a faint spin turns round the sun and scanlines stay on top. Parameters written a..b go from one value to the other over the animation, and back, so that the loop does not jump (corrode gif makes it, sh docs/examples/generate.sh makes it again):

corrode gif docs/examples/photo.jpg glitch-mix.gif --frames 14 --fps 10 --width 400 seed=11 \
    falsecolor order=rgb rotate=-70..70 saturation=130 \
    + slice slices=4..10 shift=10..70 split=true \
    + aberration amount=0.003..0.012 \
    + spin angle=0..2 center=50,45 \
    + scanlines period=3 strength=25

Goals

  • Browse a shoot, with or without JPEGs, with 100% zoom to check sharpness
  • Rate, color-label and reject photos from the keyboard
  • Store marks in RawTherapee .pp3 sidecars (Rank, ColorLabel, InTrash), no proprietary database
  • Open the matching RAW files in RawTherapee
  • Sort a selection into folders of shots that look alike (light, colour, time taken)
  • Apply a RawTherapee preset to a whole selection, adjusted for each group
  • Creative effects on pictures, written as short recipes (done, as a library and examples); a live editor for them is to come

Documentation

Installation

corrode runs on Linux and is built with Rust: the code uses let chains, so Rust 1.88 or later, with the 2024 edition.

git clone https://github.com/karasibille/corrode
cd corrode
cargo install --path cli --locked    # the corrode program

The corrode program goes to ~/.cargo/bin, which has to be in your PATH. Without installing, write cargo run --release -p corrode -- instead of corrode in the commands of the documentation. corrode --help lists the commands: select, group, preset, effect, effects, ghost, gif, bands and deband. They need RawTherapee and a terminal that shows pictures; see Requirements.

Requirements

  • Linux, a terminal supporting the Kitty or Sixel graphics protocol (e.g. kitty)
  • RawTherapee, configured to save .pp3 files next to the input files
  • Optional, to make the gallery again with docs/examples/generate.sh: ImageMagick (magick). To show an effect in the terminal with --show: kitty (kitten icat) or chafa

License

Licensed under either of Apache License 2.0 or MIT license, at your option.

The sample photo docs/examples/photo.jpg and the pictures made from it are © Káranarchist (@karanarchist on Instagram), and are not part of that licence.

About

Fast JPEG+RAW photo culling in the terminal, with RawTherapee integration and glitch effects. Written in Rust.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages