From a47af264dec4e3dc1a3efab9fe93d877cb19d9d3 Mon Sep 17 00:00:00 2001 From: Juri Dispan Date: Tue, 6 Feb 2024 16:12:53 +0100 Subject: [PATCH] pamcomp, pnmcomp, pnmconvol, pnmcrop, pnmgamma: add pages (#12197) * pamcomp, pnmcomp, pnmconvol, pnmcrop, pnmgamma: add pages * Update pages/common/pnmgamma.md Co-authored-by: K.B.Dharun Krishna --------- Co-authored-by: K.B.Dharun Krishna --- pages/common/pamcomp.md | 20 ++++++++++++++++++++ pages/common/pnmcomp.md | 8 ++++++++ pages/common/pnmconvol.md | 20 ++++++++++++++++++++ pages/common/pnmcrop.md | 20 ++++++++++++++++++++ pages/common/pnmgamma.md | 20 ++++++++++++++++++++ 5 files changed, 88 insertions(+) create mode 100644 pages/common/pamcomp.md create mode 100644 pages/common/pnmcomp.md create mode 100644 pages/common/pnmconvol.md create mode 100644 pages/common/pnmcrop.md create mode 100644 pages/common/pnmgamma.md diff --git a/pages/common/pamcomp.md b/pages/common/pamcomp.md new file mode 100644 index 0000000000..b01b429f90 --- /dev/null +++ b/pages/common/pamcomp.md @@ -0,0 +1,20 @@ +# pamcomp + +> Overlay two PAM images. +> More information: . + +- Overlay two images such with the overlay blocking parts of the underlay: + +`pamcomp {{path/to/overlay.pam}} {{path/to/underlay.pam}} > {{path/to/output.pam}}` + +- Set the horizontal alignment of the overlay: + +`pamcomp -align {{left|center|right|beyondleft|beyondright}} -xoff {{x_offset}} {{path/to/overlay.pam}} {{path/to/underlay.pam}} > {{path/to/output.pam}}` + +- Set the vertical alignment of the overlay: + +`pamcomp -valign {{top|middle|bottom|above|below}} -yoff {{y_offset}} {{path/to/overlay.pam}} {{path/to/underlay.pam}} > {{path/to/output.pam}}` + +- Set the opacity of the overlay: + +`pamcomp -opacity {{0.7}} {{path/to/overlay.pam}} {{path/to/underlay.pam}} > {{path/to/output.pam}}` diff --git a/pages/common/pnmcomp.md b/pages/common/pnmcomp.md new file mode 100644 index 0000000000..81b1164154 --- /dev/null +++ b/pages/common/pnmcomp.md @@ -0,0 +1,8 @@ +# pnmcomp + +> This command is superseded by `pamcomp`. +> More information: . + +- View documentation for the current command: + +`tldr pamcomp` diff --git a/pages/common/pnmconvol.md b/pages/common/pnmconvol.md new file mode 100644 index 0000000000..338b991c7f --- /dev/null +++ b/pages/common/pnmconvol.md @@ -0,0 +1,20 @@ +# pnmconvol + +> Convolute a PNM image. +> More information: . + +- Convolve a PNM image with the specified convolution matrix: + +`pnmconvol -matrix=-1,3,-1 {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Convolve a PNM image with the convolution matrix in the specified files, one for each layer in the input image: + +`pnmconvol -matrixfile {{path/to/matrix1,path/to/matrix2,...}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Convolve a PNM image with the convolution matrix in the specified PNM file: + +`pnmconvol {{path/to/matrix.pnm}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Normalize the weights in the convolution matrix such that they add up to one: + +`pnmconvol -matrix=-1,3,-1 -normalize {{path/to/image.pnm}} > {{path/to/output.pnm}}` diff --git a/pages/common/pnmcrop.md b/pages/common/pnmcrop.md new file mode 100644 index 0000000000..c0a70050c4 --- /dev/null +++ b/pages/common/pnmcrop.md @@ -0,0 +1,20 @@ +# pnmcrop + +> Crop PNM images. +> More information: . + +- Remove white borders on a PNM image: + +`pnmcrop -white {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Remove borders of the specified color that are on the top and left side of the image: + +`pnmcrop -bg-color {{color}} -top -left {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Determine the color of the borders to be removed by the color of the pixel in the specified corner: + +`pnmcrop -bg-corner {{topleft|topright|bottomleft|bottomright}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Leave a border with a width of `n` pixels. Additionally, specify the behaviour if the image is entirely made out of background: + +`pnmcrop -margins {{n}} -blank-image {{pass|minimize|maxcrop}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` diff --git a/pages/common/pnmgamma.md b/pages/common/pnmgamma.md new file mode 100644 index 0000000000..fed6681baf --- /dev/null +++ b/pages/common/pnmgamma.md @@ -0,0 +1,20 @@ +# pnmgamma + +> Perform gamma correction on PNM images. +> More information: . + +- Convert the image from BT.709 luminance to radiance or sRGB luminance: + +`pnmgamma -{{bt709tolinear|bt709tosrgb}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Convert the image from radiance or sRGB luminance to BT.709 luminance: + +`pnmgamma -{{lineartobt709|srgbtobt709}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Specify the gamma value used for the gamma transfer function: + +`pnmgamma -gamma {{value}} {{path/to/image.pnm}} > {{path/to/output.pnm}}` + +- Specify the gamma value used for the gamma transfer function per color component: + +`pnmgamma -rgamma {{value}} -ggamma {{value}} -bgamma {{value}} {{path/to/image.pnm}} > {{path/to/output.pnm}}`