|
|
|
|
@ -1,30 +1,12 @@
|
|
|
|
|
.\" Automatically generated by Pandoc 2.19.2 |
|
|
|
|
.\" Automatically generated by Pandoc 3.1.9 |
|
|
|
|
.\" |
|
|
|
|
.\" Define V font for inline verbatim, using C font in formats |
|
|
|
|
.\" that render this, and otherwise B font. |
|
|
|
|
.ie "\f[CB]x\f[]"x" \{\ |
|
|
|
|
. ftr V B |
|
|
|
|
. ftr VI BI |
|
|
|
|
. ftr VB B |
|
|
|
|
. ftr VBI BI |
|
|
|
|
.\} |
|
|
|
|
.el \{\ |
|
|
|
|
. ftr V CR |
|
|
|
|
. ftr VI CI |
|
|
|
|
. ftr VB CB |
|
|
|
|
. ftr VBI CBI |
|
|
|
|
.\} |
|
|
|
|
.TH "DIDDER" "1" "December 20, 2022" "didder v1.2.0" "User Manual" |
|
|
|
|
.hy |
|
|
|
|
.TH "DIDDER" "1" "December 20, 2023" "didder v1.3.0" "User Manual" |
|
|
|
|
.SH NAME |
|
|
|
|
.PP |
|
|
|
|
didder \[em] dither images |
|
|
|
|
.SH SYNOPSIS |
|
|
|
|
.PP |
|
|
|
|
\f[B]didder\f[R] [global options] command [command options] |
|
|
|
|
[arguments\&...] |
|
|
|
|
.SH DESCRIPTION |
|
|
|
|
.PP |
|
|
|
|
Dither images with a variety of algorithms and processing options. |
|
|
|
|
.PP |
|
|
|
|
Images with transparency are supported, and their alpha channel is kept |
|
|
|
|
@ -38,7 +20,9 @@ input image(s).
|
|
|
|
|
The most important parts of this manual are highlighted in the |
|
|
|
|
\f[B]TIPS\f[R] section, make sure you check it out! |
|
|
|
|
.PP |
|
|
|
|
Homepage: <https://github.com/makeworld-the-better-one/didder> |
|
|
|
|
Homepage: \c |
|
|
|
|
.UR https://github.com/makeworld-the-better-one/didder |
|
|
|
|
.UE \c |
|
|
|
|
.SH OPTIONS |
|
|
|
|
.TP |
|
|
|
|
\f[B]-i\f[R], \f[B]--in\f[R] \f[I]PATH\f[R] |
|
|
|
|
@ -52,8 +36,9 @@ The input file path can also be parsed as a glob.
|
|
|
|
|
This will only happen if the path contains an asterisk. |
|
|
|
|
For example \f[B]-i \[aq]*.jpg\[cq]\f[R] will select all the .jpg files |
|
|
|
|
in the current directory as input. |
|
|
|
|
See this page for more info on glob pattern matching: |
|
|
|
|
<https://golang.org/pkg/path/filepath/#Match> |
|
|
|
|
See this page for more info on glob pattern matching: \c |
|
|
|
|
.UR https://golang.org/pkg/path/filepath/#Match |
|
|
|
|
.UE \c |
|
|
|
|
.RE |
|
|
|
|
.TP |
|
|
|
|
\f[B]-o\f[R], \f[B]--out\f[R] \f[I]PATH\f[R] |
|
|
|
|
@ -81,8 +66,9 @@ W3C color names).
|
|
|
|
|
All colors are interpreted in the sRGB colorspace. |
|
|
|
|
.RS |
|
|
|
|
.PP |
|
|
|
|
A list of all color names is available at |
|
|
|
|
<https://www.w3.org/TR/SVG11/types.html#ColorKeywords> |
|
|
|
|
A list of all color names is available at \c |
|
|
|
|
.UR https://www.w3.org/TR/SVG11/types.html#ColorKeywords |
|
|
|
|
.UE \c |
|
|
|
|
.PP |
|
|
|
|
Images are converted to grayscale automatically if the palette is |
|
|
|
|
grayscale. |
|
|
|
|
@ -110,7 +96,11 @@ representing the image colors with the desired palette is impossible.
|
|
|
|
|
Instead of accuracy of color, the new goal is accuracy of luminance, or |
|
|
|
|
even just accuracy of contrast. |
|
|
|
|
For example, the original Nintendo Game Boy used a solely green palette: |
|
|
|
|
<https://en.wikipedia.org/wiki/List_of_video_game_console_palettes#Game_Boy>. |
|
|
|
|
\c |
|
|
|
|
.UR |
|
|
|
|
https://en.wikipedia.org/wiki/List_of_video_game_console_palettes#Game_Boy |
|
|
|
|
.UE \c |
|
|
|
|
\&. |
|
|
|
|
By setting \f[B]--palette\f[R] to shades of gray and then |
|
|
|
|
\f[B]--recolor\f[R]-ing to the desired shades of green, input images |
|
|
|
|
will be converted to grayscale automatically and then dithered in one |
|
|
|
|
@ -301,8 +291,10 @@ Or a path to JSON for your custom matrix.
|
|
|
|
|
\[aq]\f[B]-\f[R]\[cq] means standard input. |
|
|
|
|
.PP |
|
|
|
|
Here are all the built-in ordered dithering matrices. |
|
|
|
|
You can find details on these matrices here: |
|
|
|
|
<https://github.com/makeworld-the-better-one/dither/blob/v2.0.0/ordered_ditherers.go> |
|
|
|
|
You can find details on these matrices here: \c |
|
|
|
|
.UR |
|
|
|
|
https://github.com/makeworld-the-better-one/dither/blob/v2.0.0/ordered_ditherers.go |
|
|
|
|
.UE \c |
|
|
|
|
.IP \[bu] 2 |
|
|
|
|
ClusteredDot4x4 |
|
|
|
|
.PD 0 |
|
|
|
|
@ -382,12 +374,13 @@ treated the same.
|
|
|
|
|
The JSON format (whether inline or in a file) looks like the below. |
|
|
|
|
The matrix must be \[lq]rectangular\[rq], meaning each array must have |
|
|
|
|
the same length. |
|
|
|
|
More information how to use a custom matrix can be found here: |
|
|
|
|
<https://pkg.go.dev/github.com/makeworld-the-better-one/dither/v2#OrderedDitherMatrix> |
|
|
|
|
More information how to use a custom matrix can be found here: \c |
|
|
|
|
.UR |
|
|
|
|
https://pkg.go.dev/github.com/makeworld-the-better-one/dither/v2#OrderedDitherMatrix |
|
|
|
|
.UE \c |
|
|
|
|
.RE |
|
|
|
|
.IP |
|
|
|
|
.nf |
|
|
|
|
\f[C] |
|
|
|
|
.EX |
|
|
|
|
{ |
|
|
|
|
\[dq]matrix\[dq]: [ |
|
|
|
|
[12, 5, 6, 13], |
|
|
|
|
@ -397,8 +390,7 @@ More information how to use a custom matrix can be found here:
|
|
|
|
|
], |
|
|
|
|
\[dq]max\[dq]: 16 |
|
|
|
|
} |
|
|
|
|
\f[R] |
|
|
|
|
.fi |
|
|
|
|
.EE |
|
|
|
|
.TP |
|
|
|
|
\f[B]edm\f[R] \f[I]NAME/JSON/FILE\f[R] |
|
|
|
|
Error Diffusion Matrix |
|
|
|
|
@ -421,8 +413,10 @@ Or a path to JSON for your custom matrix.
|
|
|
|
|
\[aq]\f[B]-\f[R]\[cq] means stdin. |
|
|
|
|
.PP |
|
|
|
|
Here are all the built-in error diffusion matrices. |
|
|
|
|
You can find details on these matrices here: |
|
|
|
|
<https://github.com/makeworld-the-better-one/dither/blob/v2.0.0/error_diffusers.go> |
|
|
|
|
You can find details on these matrices here: \c |
|
|
|
|
.UR |
|
|
|
|
https://github.com/makeworld-the-better-one/dither/blob/v2.0.0/error_diffusers.go |
|
|
|
|
.UE \c |
|
|
|
|
.IP \[bu] 2 |
|
|
|
|
Simple2D |
|
|
|
|
.PD 0 |
|
|
|
|
@ -490,7 +484,6 @@ moving down the image, instead of going left-to-right each time.
|
|
|
|
|
This can reduce artifacts or patterns in the noise. |
|
|
|
|
.RE |
|
|
|
|
.SH TIPS |
|
|
|
|
.PP |
|
|
|
|
Read about \f[B]--strength\f[R] if you haven\[cq]t already. |
|
|
|
|
.PP |
|
|
|
|
Read about \f[B]--recolor\f[R] if you haven\[cq]t already. |
|
|
|
|
@ -530,10 +523,10 @@ original image and will not adjust your selected palette colors.
|
|
|
|
|
.SH EXAMPLES |
|
|
|
|
.TP |
|
|
|
|
\f[B]didder --palette \[dq]black white\[rq] -i input.jpg -o test.png bayer 16x16\f[R] |
|
|
|
|
This command dithers \f[V]input.jpg\f[R] using only black and white |
|
|
|
|
This command dithers \f[CR]input.jpg\f[R] using only black and white |
|
|
|
|
(implicitly converting the image to grayscale first), using a 16x16 |
|
|
|
|
Bayer matrix. |
|
|
|
|
The result is written to \f[V]test.png\f[R]. |
|
|
|
|
The result is written to \f[CR]test.png\f[R]. |
|
|
|
|
.TP |
|
|
|
|
\f[B]didder --palette \[dq]black white\[rq] -i input.jpg -o test.png odm ClusteredDot4x4\f[R] |
|
|
|
|
Same command as above, but dithering with the preprogrammed ordered |
|
|
|
|
@ -551,8 +544,10 @@ dithering artifacts can be seen more clearly.
|
|
|
|
|
\f[B]didder -i input.png -o output.png -p \[dq]1E1E1E CDCDCD EDEDED FFFFFF\[rq] -r \[dq]11161e 116bcd 63b3ed e1efff\[rq] --strength 64% --brightness 20% bayer 32x32\f[R] |
|
|
|
|
This command uses a blue recolor palette, one that is biased to being |
|
|
|
|
darker. |
|
|
|
|
The palette can be viewed at |
|
|
|
|
<https://colorpeek.com/#11161e,116bcd,63b3ed,e1efff>. |
|
|
|
|
The palette can be viewed at \c |
|
|
|
|
.UR https://colorpeek.com/#11161e,116bcd,63b3ed,e1efff |
|
|
|
|
.UE \c |
|
|
|
|
\&. |
|
|
|
|
The dithering palette is the grayscale version of those colors, to keep |
|
|
|
|
luminance accurate. |
|
|
|
|
Strength is set to 64%, which although usually recommended for Bayer |
|
|
|
|
@ -566,6 +561,6 @@ dithering and recoloring them along the way.
|
|
|
|
|
The GIF moves at 1 frame per second, and by default loops infinitely. |
|
|
|
|
Random dithering is used, with recommended default of -0.5,0.5. |
|
|
|
|
.SH REPORTING BUGS |
|
|
|
|
.PP |
|
|
|
|
Any bugs can be reported by creating an issue on GitHub: |
|
|
|
|
<https://github.com/makeworld-the-better-one/didder> |
|
|
|
|
Any bugs can be reported by creating an issue on GitHub: \c |
|
|
|
|
.UR https://github.com/makeworld-the-better-one/didder |
|
|
|
|
.UE \c |
|
|
|
|
|