No description
Find a file
Nathan Teoh 08fe674f16 feat: readme (#3)
explain my crazy thoughts

Reviewed-on: #3
Co-authored-by: Nathan Teoh <me@nathanteoh.com>
Co-committed-by: Nathan Teoh <me@nathanteoh.com>
2024-01-12 03:30:12 +00:00
img feat: readme (#3) 2024-01-12 03:30:12 +00:00
src feat: readme (#3) 2024-01-12 03:30:12 +00:00
.gitignore feat: CLI (#1) 2024-01-12 01:47:40 +00:00
Cargo.lock feat: parallel (#2) 2024-01-12 02:51:36 +00:00
Cargo.toml feat: parallel (#2) 2024-01-12 02:51:36 +00:00
README.md feat: readme (#3) 2024-01-12 03:30:12 +00:00

Ditherpunk


What is this

This is a command-line tool that converts an image to a limited colorspace, utilizing dithering.

Currently, the following options are hardcoded:

  • the 1bit color palette is hardcoded
  • the desired output resolution

You can modify these in src/bayer.rs. However, it is my plan to make those user configurable.


Usage

ditherpunk <INPUT> <OUTPUT> <COMMAND>

Commands: bayer
error-diffusion
help Print this message or the help of the given subcommand(s)

Arguments: <INPUT>
<OUTPUT>

Options: -h, --help Print help -V, --version Print version

eg:

    ditherpunk input_folder output_folder bayer --level 3

note: Currently level works internally like [1,level]. It will generate all levels from 1 to the level you provide. I might change this behavior in the future.

Input image:

input image

Output (3 levels)

output image level 1

output image level 2

output image level 3


Bugs

  • Filename bug. yuck. ugly. I'll fix it i promise. Code underneath is real ugly im sorry.

Future of the project

I want to build a simple API and webapp, utilizing code I wrote here.

I also want to try and add other interesting dithering and half-toning methods.


Credits

Ditherpunk -- The article I wish I had about monochrome image dithering - Surma

Ordered Dithering - Wikipedia

Color QUantization and Dithering - Acerola