Chromatic is a private image hosting site focused on optimizing web experience.
Run this server on a decent machine!
Image encoding, especially using libaom for AVIF encoding, requires a lot of CPU and memory resources. You should have at least 8GB memory for a 4096x4096 size image.
This site uses MongoDB as database.
To deploy the site, follow the steps below.
- Get a domain.
- Create a reCAPTCHA key for your site. You can get one free at here.
- Copy
config.example.toml
toconfig.toml
, and change the config items to your need. - Replace default website key (
6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
) to yours inmain.*.js
andmain.*.js.map
. - (Optional) Copy and execute
compress.sh
instatic
folder to get brotli and gzip compressed static files. - Everything ready. Run the executable to start the server.
To build this project from source, follow the instructions below.
On Linux, You should have libpng,
libjpeg(mozjpeg, optimally),
libwebp and
libavif installed with headers and
static library available for compiler. Specially, mozjpeg's default install dir
/opt/mozjpeg/
will also be considered.
On Windows, you should have the same libraries, with headers and libraries
placed in c/header
and c/libs
.
This project has a small wrapper written in C. You need cmake
to build it.
This can be build on Linux and Windows(using MinGW).
cd c
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release ..
make
Build Go part is simple.
go build -tags=jsoniter .
If you want to remove some debug info to reduce executable size, use
go build -tags=jsoniter -ldflags="-s -w" ..
Please follow the instruction in the front
folder.