From 0638b8d95da26503c4ca64de2d36c951fec74d55 Mon Sep 17 00:00:00 2001 From: Juri Dispan Date: Sat, 4 Nov 2023 15:17:59 +0100 Subject: [PATCH] pamdepth, ppmdither, pamditherbw, pnmdepth: add pages (#11379) * pamdepth, pamdither, pamditherbw: add pages * pnmdepth: add alias page --- pages/common/pamdepth.md | 8 ++++++++ pages/common/pamditherbw.md | 20 ++++++++++++++++++++ pages/common/pnmdepth.md | 8 ++++++++ pages/common/ppmdither.md | 16 ++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 pages/common/pamdepth.md create mode 100644 pages/common/pamditherbw.md create mode 100644 pages/common/pnmdepth.md create mode 100644 pages/common/ppmdither.md diff --git a/pages/common/pamdepth.md b/pages/common/pamdepth.md new file mode 100644 index 000000000..f9cea141a --- /dev/null +++ b/pages/common/pamdepth.md @@ -0,0 +1,8 @@ +# pamdepth + +> Reduce the depth (i.e. color resolution) in an image. +> More information: . + +- Read a PBM image, set its maxval and save it to a file: + +`pamdepth {{maxval}} {{path/to/image.pbm}} > {{path/to/file.pbm}}` diff --git a/pages/common/pamditherbw.md b/pages/common/pamditherbw.md new file mode 100644 index 000000000..3ca2482ef --- /dev/null +++ b/pages/common/pamditherbw.md @@ -0,0 +1,20 @@ +# pamditherbw + +> Apply dithering to a greyscale image, i.e. turn it into a pattern of black and white pixels that look the same as the original greyscale. +> More information: . + +- Read a PGM image, apply dithering and save it to a file: + +`ppmditherbw {{path/to/image.pgm}} > {{path/to/file.pgm}}` + +- Use the specified quantization method: + +`ppmditherbw -{{floyd|fs|atkinson|threshold|hilbert|...}} {{path/to/image.pgm}} > {{path/to/file.pgm}}` + +- Use the atkinson quantization method and the specified seed for a pseudo-random number generator: + +`ppmditherbw -atkinson -randomseed {{1337}} {{path/to/image.pgm}} > {{path/to/file.pgm}}` + +- Specify the thresholding value for quantization methods that perform some sort of thresholding: + +`ppmditherbw -{{fs|atkinson|thresholding}} -value {{0.3}} {{path/to/image.pgm}} > {{path/to/file.pgm}}` diff --git a/pages/common/pnmdepth.md b/pages/common/pnmdepth.md new file mode 100644 index 000000000..ed0252abb --- /dev/null +++ b/pages/common/pnmdepth.md @@ -0,0 +1,8 @@ +# pnmdepth + +> This command is an alias of `pamdepth`. +> More information: . + +- View documentation for the original command: + +`tldr pamdepth` diff --git a/pages/common/ppmdither.md b/pages/common/ppmdither.md new file mode 100644 index 000000000..5efdf4000 --- /dev/null +++ b/pages/common/ppmdither.md @@ -0,0 +1,16 @@ +# ppmdither + +> Reduce the number of colors in an image by applying dithering. +> More information: . + +- Read a PPM image, apply dithering and save it to a file: + +`ppmdither {{path/to/image.ppm}} > {{path/to/file.ppm}}` + +- Specify the desired number of shades for each primary color: + +`ppmdither -red {{2}} -green {{3}} -blue {{2}} {{path/to/image.ppm}} > {{path/to/file.ppm}}` + +- Specify the dimensions of the dithering matrix: + +`ppmdither -dim {{2}} {{path/to/image.ppm}} > {{path/to/file.ppm}}`