PIXCROP(1)

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

πŸ’… pixcrop(1) β€” bestie, it's from the BRL-CAD fam πŸŽ€

okay so before we even start: this is the pixcrop manual page from BRL-CAD, and I'm about to explain the whole thing to you like we're texting at 2am. stay with me, it's literally so good. ✨


🌸 NAME 🌸

pixcrop β€” crop color pix files πŸ¦‹

like, you have a big pix file, you want a smaller slice of it, that's the entire vibe.


✨ SYNOPSIS ✨

pixcrop in.pix out.pix

pixcrop in.pix out.pix inwidth outwidth outheight ulx uly urx ury lrx lry llx lly

two forms, pick your fighter πŸ’…


πŸ’– DESCRIPTION πŸ’–

so pixcrop crops any quadrilateral out of an arbitrarily large pix(5) input file (in.pix), squares that region to a given height and width output size, and writes the result to out.pix. yes, any quadrilateral. not just rectangles. we love a flexible icon. πŸ‘‘

the first form of pixcrop prompts you for all the parameters it needs to do the cropping β€” very "let's do this together" energy. all your responses should be pixel counts or first quadrant coordinates, no cap. 🫢

the second form lets you give all the needed parameters right on the command line and is intended for use from shell scripts. script girlies rise up, this one's for you. ⭐

okay, the coordinate names β€” those eight arguments listed above after outheight β€” they refer to the input file, and more specifically to upper-left-x (ulx), lower-right-y (lry), etc., in clockwise-from-upper-left order. iykyk, but write it down anyway: ulx uly urx ury lrx lry llx lly. πŸŽ€

real talk: the nearest input pixel is selected for each output pixel. no interpolation is done by this program. none. zero. it's giving "what you see is what you get." πŸ’€

and pixcrop takes no command-line options β€” every single parameter gets supplied either interactively or as the positional arguments shown in the second synopsis form. that's it, that's the whole deal ✨


πŸ¦‹ EXAMPLES πŸ¦‹

Example 1 β€” crop an upright 200x100 region out of a 512-wide image 🌈

pixcrop in.pix out.pix 512 200 100 100 400 300 400 300 200 100 200

reads the 512-pixel-wide in.pix and writes a 200x100 out.pix extracted from the axis-aligned rectangle whose input corners are:

  • upper-left (100,400)
  • upper-right (300,400)
  • lower-right (300,200)
  • lower-left (100,200)

and because the four corners need not form a rectangle, skewed or sheared quadrilaterals can be rectified into an upright output image. ok that's actually iconic. geometry ate. πŸ“πŸ’…


🌟 SEE ALSO 🌟

go read those next, bestie, they're all part of the same little family 🧚


πŸ’œ AUTHOR πŸ’œ

BRL-CAD Team πŸ‘‘


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


πŸ”₯ BUG REPORTS πŸ”₯

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org πŸ“§ β€” be nice, they're doing their best 🫢


okay byeeee πŸ’– this was brought to you by BRL-CAD, version pixcrop(1) β€” same source, same page name, and the date is whatever the day you're reading this is, because this page is eternal. slay. πŸŒΈβœ¨πŸ¦‹

πŸ“¦ where this page comes from