Go to file
heyarne c755e4f085 Update flake.nix description 2022-03-22 00:27:08 +01:00
cmd Write metadata into file 2022-03-20 23:48:47 +01:00
epd Fix clipping when converting 2022-03-21 00:09:42 +01:00
.envrc Initial commit 2022-02-07 22:37:03 +01:00
.gitignore Enable gzip compression 2022-03-08 10:12:11 +01:00
LICENSE Use AGPL 2022-02-13 19:36:44 +01:00
README.md Add README 2022-02-13 19:43:05 +01:00
cat.data Update flake.nix description 2022-03-22 00:27:08 +01:00
default.nix Enable gzip compression 2022-03-08 10:12:11 +01:00
flake.lock Initial commit 2022-02-07 22:37:03 +01:00
flake.nix Update flake.nix description 2022-03-22 00:27:08 +01:00
go.mod Enable gzip compression 2022-03-08 10:12:11 +01:00
go.sum Enable gzip compression 2022-03-08 10:12:11 +01:00
main.go Use AGPL 2022-02-13 19:36:44 +01:00
shell.nix Reorganize nix files 2022-02-11 21:53:48 +01:00



This project contains the source code to the inkpot cli, a tool that can be used to convert JPEG, PNG and GIF images to 4-bit, 16-color grayscale images. The image format is designed to be simple to decode.


# inkpot help
A command-line-tool that can be used to prepare images by
resizing them, rotating them and converting them to 16-color
grayscale so they can be comfortably displayed on e-ink
displays powered by the epdiy driver.

  inkpot-cli [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  convert     Convert a single file to a 4-bit, 16-color grayscale image
  help        Help about any command
  serve       Run a webserver to convert images via HTTP

  -h, --help   help for inkpot-cli

Use "inkpot-cli [command] --help" for more information about a command.


The package is written in go and you can use all the standard go tooling to run and build the binary. The individual commands are defined in the cmd/ folder, the encoding / decoding bits are in epd/.

If you are using the nix package manager, there is a description of the build and dev environment in default.nix, shell.nix and flake.nix / flake.lock. It is recommended to use https://direnv.net/ with flakes support.

Image Format (in progress)

An image blob starts with a header containing ascii-encoded key-value pairs. It holds meta-information (such as an image's width w and height h), where case-insensitive keys are separated from values using a space and a colon character (: ). A value ends with a newline character (\n). The end of the header data is marked by two consecutive newline characters (\n\n).

The actual image data is following the header as a sequence of nibbles, or groups of four bits. Each nibble determines the grayscale value of a single pixel, where the first w nibbles designate the grayscale values of the first row of pixels (0 is black and 16 is white from left to right, the group of nibbles from w + 1 to 2w the second row of pixels from left to right and so on.