This is an image editing software which aims to turns regular photos into ditherpunk illustrations.
Ditherpunk is a pixel art style which is charactized by low number of colors (often 1-bit, black & white) making the use of dithering necessary to create the illusion of shading. There are a couple of indie games making fantastic use of this aesthetic, like Return of the Obra Dinn and Critters for Sale.
This repo doesn't have a release yet, just install the rust toolchain, use your favourite shell, and:
cargo run -- input/file/path.png output/file/path.png path_to_config.json
NOTE: currently only PNG format is available as output, regardless of what extension you use in your path.
The program needs a config file to know how to edit your images:
{
"processing_width": 300, // max width at which all the processing is done (ratio is preserved)
"processing_height": 300, // max height at which all the processing is done (ratio is preserved)
"brigthness_delta": 30, // increase/decrease brightness before dithering
"constrast_delta": 30, // increase/decrease contrast before dithering
"dithering_type": "blue_noise", // the dithering technique used, see list
"color_map": [ // optional field: custom list of colors used for dithering, (default is black and white)
{
"color": "#101010", // color in hex, the '#' at the beggining is optional
"magnitude": 0.8 // optional field: affects the amount of color used
},
{
"color": "0000aa", // doesn't matter if the letters are in uppercase or lowercase
"offset": 0.15, // optional field: bias for lighter/darker color
"magnitude": 0.85
},
{
"color": "10F022",
"offset": 0.50,
"magnitude": 0.5
},
"f0f0f0" // shorthand for when not using offset or magnitude
],
"output_scale": 4 // scale the image before writing it (done to preserve the pixel effect)
}rand- pure randomness, works better with bigger processing sizesbayer_0- Bayer(0) 2x2 matrix, clear patternsbayer_1- Bayer(1) 4x4 matrix, clear patternsbayer_2- Bayer(2) 8x8 matrix, can leave some unpleasing artefacts on the imagebayer_3- Bayer(3) 16x16 matrix, can leave some unpleasing artefacts on the imageblue_noise- uses a pre-computed 128x128 blue noise textureatkinson- error-diffusion with the Atkinson matrix (NOT IMPLEMENTED)jarvis- error-diffusion with the Jarvis-Judice-Ninke matrix (NOT IMPLEMENTED)floyd- error-diffusion with the Floyd-Steinberg matrix (NOT IMPLEMENTED)