15 releases (4 breaking)
|0.6.0||Sep 15, 2021|
|0.5.0||Sep 10, 2021|
|0.4.3||Aug 22, 2021|
|0.3.4||Aug 19, 2021|
|0.2.3||Aug 14, 2021|
#245 in Images
48 downloads per month
censor is a standalone palette analyser inspired by DawnBringer's Palette Analyser for GrafX2 and having a compatible layout.
It helps creating and evaluating restricted palettes by providing visualisations and highlighting certain properties.
Install the rust toolchain using
rustup or the repository. Then run:
$ cargo install censor-analyser
To see all the flags and descriptions, pass
censor and its subcommands.
The default output is written into
in the working directory even if the file exists.
Specify another output file with
-o another.png argument.
To use black, grey and white for UI instead of
choosing palette colours, pass the
The illuminant is a daylight illuminant
with the white point generated by the temperature T
in Kelvins, 5500 by default;
-T may be used to redefine T;
-D may be used for the following presets:
If the input image is png or jpeg and it
has an embedded colour profile, that
profile will be copied into the analysis image.
-j to test the experimental multithreaded
Analyse a palette from an image
$ censor analyse -i input.png
Analyse a palette from a text file
$ censor analyse -f input.hex
Analyse a palette from manually specified hexcodes
$ censor analyse -c 2e3037,ebe5ce
Analyse a palette from lospec.com
$ censor analyse -l aurora
Palette input and illuminant options are the same as for
In addition, there are options for specifying which metrics should be
-a, --all activates all the metrics.
There are also flags for individual metrics (see the help page).
The output is formatted in csv to be script-friendly.
Start daemon mode on port
$ censor daemon -p 8008
Once the daemon is running, send commands after connecting to the port (one command per connection). The syntax is the same as for the command-line app, but:
- You should omit the first
daemoncommand is not available.
analyseis no longer optional.
An example of a valid palette analysis request (assuming that the daemon is started on port 9876 on a Linux/Mac machine):
$ echo "analyse -l antiquity16 -o plot.png" | nc localhost 9876
OK is returned. On error,
ERR is returned and
more error info is printed in the next lines and also into daemon's
Reduces provided image's palette to the specified one.
Palette input, illuminant, output file options are the same.
The dithering method is determined by the following options:
--nodither results in finding the nearest colour for each pixel;
--bayer N results in ordered dithering with Bayer matrix of size 2^N;
--whitenoise WxH results in ordered dithering with a white noise of size WxH;
--bluenoise WxH results in ordered dithering with a blue noise of size WxH.
By default, blue noise of size 14x14 is applied - that is expected to be frequently
Other methods will be added.
You are also required to provide a path to the input image. Note that the resulting image will always be in PNG format.
An example of a valid image dithering command:
$ censor dither mona_lisa.jpg -l warmlight --bluenoise 18x18 -o mona_lisa.dithered.png
- Analyse palettes of 2-256 colours
- All widgets use CAM16UCS with perceptual colour distances
- Load colours from command line arguments, text files, images and Lospec
- Daemon mode for large amounts of analysis requests
- Image dithering
- WASM support for analysing palettes on web pages client-side (currently broken)
- Rectangular hue-lightness with fixed chroma
- Spectral colours (with the non-spectral CIExy line added)
- Spectral box (with
yparametrising a parabola going through pure black, the spectral colour and pure white)
- Indexed palette
- Close colours (with different lightness weights)
- Internal similarity (which is
- Acyclic check
- "Spectral" distribution (from hue-mapping nearest spectral colours relative to the white point)
- "Temperature" distribution (normalised
-log(CCT), might be changed later)
- Greyscale with differing lightness weights
- Cubes showing the colours in CAM16UCS space from different angles
- Hue-lightness plot
- Useful colour mixes (i.e. producing points that are further from other palette points)
- Lightness-chroma bars
- Lightness-sorted colours and neutralisers
- 12-bit RGB approximation
- Polar hue-chroma plot
- Polar hue-lightness with fixed chroma levels