PNMSHEAR(1)
π PNMSHEAR(1) β the Pnmshear User Manual, bestie edition π
okay so welcome to the Pnmshear User Manual, section 1, general commands manual moment. this is the page that explains pnmshear, and yes it's giving "niche utility that absolutely serves" energy. let's gooo π¦
β¨ NAME β¨
pnmshear β shear a PNM image by a specified angle
πΈ SYNOPSIS πΈ
pnmshear
[-noantialias] [-background=color] angle [pnmfile]
quick house rules, no cap π:
- All options can be abbreviated to their shortest unique prefix.
- You may use two hyphens instead of one to designate an option.
- You may use either white space or equals signs between an option name and its value.
π DESCRIPTION π
So bestie, this program is part of Netpbm(1). π«Ά
pnmshear reads a PNM image as input, shears it by the specified angle, and produces a PNM image as output. If the input file is in color, the output will be too β otherwise it will be grayscale. the way it just inherits the whole vibe of its input? iconic honestly. π
The angle is in degrees (floating point), and it measures this:
+-------+ +-------+
| | |\ \
| OLD | | \ NEW \
| | |an\ \
+-------+ |gle+-------+
If the angle is negative, it shears the other way:
+-------+ |-an+-------+
| | |gl/ /
| OLD | |e/ NEW /
| | |/ /
+-------+ +-------+
β οΈ okay so real talk: the angle should not get too close to90or-90, or the resulting image will be unreasonably wide. and not in a cute way. In fact, if it gets too close, the width will be so large thatpnmshearcannot do computations in the word sizes it uses, and the program detects this and fails. it knows its limits, we love a self-aware icon. π
Now for the tea on how it does the thing: pnmshear does the shearing by looping over the source pixels and distributing fractions to each of the destination pixels. This has an "anti-aliasing" effect β it avoids jagged edges and similar artifacts. β¨
But β and this is the plot twist β it also means that the original colors in the image are modified and there are typically more of them than you started with. If you need to keep precisely the same set of colors, see the -noantialias option. And if the expanded palette is a problem, you can run the result through pnmquant. problem solved, slay. π
π OPTIONS π
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pnmshear recognizes the following command line options:
-background=colorβ this determines the color of the background on which the sheared image sits.
Specify the color (color) as described for the argument of the pnm_parsecolor() library routine.
By default, if you don't specify this option, pnmshear selects what appears to it to be the background color of the original image. It determines this color rather simplistically, by taking an average of the colors of the two top corners of the image. lowkey unhinged but it works. π
This option was new in Netpbm 10.37 (December 2006). Before that, pnmshear always behaved as is the default now.
-noantialiasβ this option forcespnmshearto simply move pixels around instead of synthesizing output pixels from multiple input pixels. The latter could cause the output to contain colors that are not in the input, which may not be desirable. It also probably makes the output contain a large number of colors. If you need a small number of colors, but it doesn't matter if they are the exact ones from the input, consider usingpnmquanton the output instead of using-noantialias.
Note that to ensure the output does not contain colors that are not in the input, you also must consider the background color. See the -background option. π
π¦ SEE ALSO π¦
pnmrotate(1), pamflip(1), pamhomography(1), pnmquant(1), pamrestack(1), pnm(1)
π AUTHOR π
Copyright (C) 1989, 1991 by Jef Poskanzer.
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/pnmshear.html
and that's the whole page bestie, you're officially pnmshear-pilled π no cap, this was netpbm documentation, 22 March 2020 β catch you on the flip side, mwah π«Άβ¨π
π¦ where this page comes from
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms