pamflip, pnmcolormap, pnmquant, pnmremap, pnmrotate, ppmquant: add pages (#11800)

* pamflip, pnmcolormap, pnmquant, pnmremap, pnmrotate, ppmquant: add pages

---------

Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
pull/23/head
Juri Dispan 2023-12-21 07:03:10 +01:00 committed by GitHub
parent 5c0c622ef2
commit 13dc362fa8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 0 deletions

20
pages/common/pamflip.md Normal file
View File

@ -0,0 +1,20 @@
# pamflip
> Flip or rotate a PAM or PNM image.
> More information: <https://netpbm.sourceforge.net/doc/pamflip.html>.
- Rotate the input image counter-clockwise for a specific degree:
`pamflip -rotate{{90|180|270}} {{path/to/input.pam}} > {{path/to/output.pam}}`
- Flip left for right:
`pamflip -leftright {{path/to/input.pam}} > {{path/to/output.pam}}`
- Flip top for bottom:
`pamflip -topbottom {{path/to/input.pam}} > {{path/to/output.pam}}`
- Flip the input image on the main diagonal:
`pamflip -transpose {{path/to/input.pam}} > {{path/to/output.pam}}`

View File

@ -0,0 +1,16 @@
# pnmcolormap
> Create quantization color map for a PNM image.
> More information: <https://netpbm.sourceforge.net/doc/pnmcolormap.html>.
- Generate an image using only `n_colors` or less colors as close as possible to the input image:
`pnmcolormap {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.ppm}}`
- Use the splitspread strategy for determining the output colors, possibly producing a better result for images with small details:
`pnmcolormap -splitspread {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.ppm}}`
- Sort the resulting colormap, which is useful for comparing colormaps:
`pnmcolormap -sort {{path/to/input.pnm}} > {{path/to/output.ppm}}`

9
pages/common/pnmquant.md Normal file
View File

@ -0,0 +1,9 @@
# pnmquant
> Quantize the colors in a PNM image into a smaller set.
> This command is a combination of `pnmcolormap` and `pnmremap` and accepts the union of their options, except `-mapfile`.
> More information: <https://netpbm.sourceforge.net/doc/pnmquant.html>.
- Generate an image using only `n_colors` or less colors as close as possible to the input image:
`pnmquant {{n_colors}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`

20
pages/common/pnmremap.md Normal file
View File

@ -0,0 +1,20 @@
# pnmremap
> Replace the colors in a PNM image.
> More information: <https://netpbm.sourceforge.net/doc/pnmremap.html>.
- Replace the colors in an image with those in the specified color palette:
`pnmremap -mapfile {{path/to/palette_file.ppm}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Use Floyd-Steinberg dithering for representing colors missing in the color palette:
`pnmremap -mapfile {{path/to/palette_file.ppm}} -floyd {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Use the first color in the palette for representing colors missing in the color palette:
`pnmremap -mapfile {{path/to/palette_file.ppm}} -firstisdefault {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Use the specified color for representing colors missing in the color palette:
`pnmremap -mapfile {{path/to/palette_file.ppm}} -missingcolor {{color}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`

16
pages/common/pnmrotate.md Normal file
View File

@ -0,0 +1,16 @@
# pnmrotate
> Rotate a PNM image.
> More information: <https://netpbm.sourceforge.net/doc/pnmrotate.html>.
- Rotate a PNM image by some angle (measured in degrees, counter-clockwise):
`pnmrotate {{angle}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Specify the background color exposed by rotating the input image:
`pnmrotate -background {{color}} {{angle}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`
- Disable anti-aliasing, improving performance but decreasing quality:
`pnmrotate -noantialias {{angle}} {{path/to/input.pnm}} > {{path/to/output.pnm}}`

12
pages/common/ppmquant.md Normal file
View File

@ -0,0 +1,12 @@
# ppmquant
> This command has been replaced by `pnmquant` and `pnmremap`.
> More information: <https://netpbm.sourceforge.net/doc/ppmquant.html>.
- View documentation for `pnmquant`:
`tldr pnmquant`
- View documentation for `pnmremap`:
`tldr pnmremap`