PIXROT(1)

πŸ“¦
version 7.44.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… PIXROT(1) β€” the BRL-CAD glow-up ✨

okay bestie, so this is pixrot, page 1 of the BRL-CAD manuals, and it is literally the rotate/invert/reverse girlie for your color pix files πŸŽ€


🌸 NAME 🌸

pixrot β€” rotates, inverts, or reverses a color pix file. that's it, that's the whole job, and she does it flawlessly πŸ’–


✨ SYNOPSIS ✨

pixrot [-f] [-b] [-r] [-i] [-#bytes] [-s squaresize] [-w width] [-n height] [file.pix] > newfile.pix

read it, learn it, love it 🫢 note the > newfile.pix β€” output goes to stdout, so you redirect it, mwah.


πŸ’« DESCRIPTION πŸ’«

so pixrot rotates, inverts, and/or reverses a pix(5) format color image. it reads from the named file, or from standard input if you don't name one, and writes the result to standard output. no cap, that's the whole vibe.

the input dimensions come from -w (width) and -n (height), or from -s when your image is square. both default to 512, so if you forget, she assumes 512. iconic but also, like, pay attention πŸ’€

  • the -r flag reverses each scan line left to right πŸ¦‹
  • -i inverts the image top to bottom πŸ™ˆ

and then the icons:

  • -f and -b rotate the image ninety degrees forward or backward respectively. the sense is relative to a first-quadrant coordinate system (origin lower left), with "forward" meaning clockwise ⏰ iykyk
  • a 180 degree rotation? that's just both reversing and inverting. two flags, one flip, slay πŸ’…

by default, three-byte (RGB) pixels are assumed. the -# bytes flag selects a different element size β€” so the same program can rotate rectangular arrays of any fixed-width datum, like floating point values or fixed-width text. she's not just a pretty face, she's versatile πŸ‘‘

now the important caveat, listen up: the output is written largely in scan-line order. if the image is too large to hold in memory at once, pixrot seeks on output β€” so for the rotation modes, standard output must be a seekable file rather than a pipe. like, a pipe is not it, bestie. > file yes, | no 😭


πŸŽ€ OPTIONS πŸŽ€

  • -f β€” rotate the image ninety degrees forward (clockwise) ⏰
  • -b β€” rotate the image ninety degrees backward (counter-clockwise) πŸ”„
  • -r β€” reverse each scan line left to right πŸ¦‹
  • -i β€” invert the image top to bottom πŸ™ˆ
  • -# bytes β€” set the number of bytes per pixel (default 3, as in pix(5)) πŸ“
  • -s squaresize β€” set both the input width and height to squaresize pixels (also -S)
  • -w width β€” set the input width in pixels (default 512, also -W)
  • -n height β€” set the input number of scan lines in pixels (default 512, also -N)
  • -h β€” print a usage message 🫢
ngl the uppercase aliases -S, -W and -N are right there in the options list, so use 'em if that's your thing πŸ’œ

πŸ”₯ EXAMPLES πŸ”₯

⭐ Example 1. Rotate a rendered frame and view it

rt -o frame.pix -w 1024 -n 768 model.g component.r
pixrot -w 1024 -n 768 -f frame.pix > frame-rot.pix
pix-png -w 768 -n 1024 frame-rot.pix > frame-rot.png

so first you render a 1024x768 image with rt(1), then you rotate it ninety degrees clockwise β€” and notice the rotated image is 768x1024, because obviously the dimensions swap, duh πŸ’… β€” then you convert it to PNG with pix-png(1). the way that pipeline just works πŸ˜­πŸ’–

⭐ Example 2. Flip an image 180 degrees

pixrot -s 512 -r -i image.pix > image-180.pix

combine a left-to-right reversal with a top-to-bottom inversion to turn a 512x512 image upside down. that's the 180, bestie, no rotation flag needed πŸ™ˆβœ¨


🌈 SEE ALSO 🌈

brlcad(1), bwrot(1), pixscale(1), pixrect(1), pix-png(1), pix(5)

go read the whole friend group, they're all iconic πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team β€” legends, honestly 🫢


this software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.


πŸ¦‹ BUG REPORTS πŸ¦‹

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org πŸ“§ don't be shy, they want to know πŸŽ€


and that's the page!! this was PIXROT(1) from the BRL-CAD manual set β€” source/version: BRL-CAD, page PIXROT(1), footer dated as shown above β€” mwah, go rotate something πŸ’‹βœ¨

πŸ“¦ where this page comes from