PNMROTATE(1)
π« pnmrotate β the it-girl of image rotation π«
okay bestie, welcome to the Pnmrotate User Manual(1) page, general commands manual energy, and let me tell you she serves. this is pnmrotate, and she rotates a PNM image by some angle. that's it. that's the gig. iconic. π
β¨ NAME β¨
pnmrotate β rotate a PNM image by some angle
β¨ SYNOPSIS β¨
pnmrotate [-noantialias] [-background=color] angle [pnmfile]
β¨ DESCRIPTION β¨
okay so first thing, this program is part of Netpbm(1) β she's got a whole family, we love a supportive household. π«Ά
pnmrotate reads a PNM image as input. then it rotates it by the specified angle, and it produces the same kind of PNM image as output. same kind, no genre-switching, we keep the vibe consistent. β¨
The input is the file named by pnmfile β or Standard Input if you don't specify pnmfile. The output goes to Standard Output.
The resulting image is a rectangle that contains the (rectangular) input image within it, rotated with respect to its bottom edge. The containing rectangle is as small as possible to contain the rotated image β snug, no wasted space, she's fitted. π
The background of the containing image is a single color that pnmrotate determines to be the background color of the original image, or that you specify explicitly. your choice, bestie.
angle is in decimal degrees (floating point), measured counter-clockwise. It can be negative, but it should be between -90 and 90. stay in your lane, angle. π
π¨ real talk: for rotations that are a multiple of a quarter turn, you should use pamflip instead. It is faster and more accurate. no cap.
For rotations greater than 45 degrees you may get better results if you first use pamflip to do a 90 degree rotation and then pnmrotate less than 45 degrees back the other direction. it's giving teamwork honestly. π¦
The rotation algorithm is Alan Paeth's three-shear method. Each shear is implemented 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. silky smooth, obsessed. However, it also means that the original colors or gray levels in the image are modified. so if you need to keep precisely the same set of colors, you can use the -noantialias option.
The program runs faster and uses less real memory with the -noantialias option. It uses a large amount of virtual memory either way, as it keeps a copy of the input image and a copy of the output image in memory, using 12 bytes per pixel for each. 12 bytes per pixel per copy. she's hungry. But with -noantialias, it accesses this memory sequentially in half a dozen passes, with only a few pages of memory at a time required in real memory.
In contrast, without -noantialias, the program's real memory working set size is one page per input image row plus one page per output image row. Before Netpbm 10.16 (June 2003), -noantialias had the same memory requirement. history lesson, bestie, we love context π
β¨ OPTIONS β¨
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), pnmrotate recognizes the following command line options:
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. flexible queen behavior β¨
-background=colorβ this determines the color of the background on which the rotated 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, pnmrotate 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. two corners. an average. that's the whole detective work. π
This option was new in Netpbm 10.15. Before that, pnmrotate always behaved as is the default now.
-noantialiasβ this option forcespnmrotateto 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. don't forget the background, she counts too!!
β¨ REFERENCES β¨
"A Fast Algorithm for General Raster Rotation" by Alan Paeth, Graphics Interface '86, pp. 77-81. π cite your sources, bestie, it's a whole look
β¨ SEE ALSO β¨
pnmshear(1), pamflip(1), pnmquant(1), pnm(1)
the whole friend group, go say hi π«Ά
β¨ 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/pnmrotate.html
okay that's the whole page, bestie, you're officially certified in pnmrotate π
this was netpbm documentation, dated 30 August 2002, and yes she's still that girl β go rotate something and slay β¨π¦π
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- 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