1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-18 09:15:45 +02:00
tldr/pages/common/pamditherbw.md

22 lines
946 B
Markdown
Raw Normal View History

# 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.
> See also: `pbmreduce`.
> More information: <https://netpbm.sourceforge.net/doc/pamditherbw.html>.
- Read a PGM image, apply dithering and save it to a file:
2025-07-22 19:37:46 +03:00
`pamditherbw {{path/to/image.pgm}} > {{path/to/file.pgm}}`
- Use the specified quantization method:
2025-07-22 19:37:46 +03:00
`pamditherbw -{{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:
2025-07-22 19:37:46 +03:00
`pamditherbw {{[-a|-atkinson]}} {{[-r|-randomseed]}} {{1337}} {{path/to/image.pgm}} > {{path/to/file.pgm}}`
- Specify the thresholding value for quantization methods that perform some sort of thresholding:
2025-07-22 19:37:46 +03:00
`pamditherbw -{{fs|atkinson|thresholding}} {{[-va|-value]}} {{0.3}} {{path/to/image.pgm}} > {{path/to/file.pgm}}`