BWCROP(1)

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

πŸ’… BWCROP(1) β€” the crop queen of the BRL-CAD manual pages πŸŽ€

okay so bestie, welcome to bwcrop(1) β€” yes that's the manual page name, we're doing this properly ✨


🌸 NAME 🌸

bwcrop β€” literally just crops black and white bw files. that's the whole gig. no cap πŸ’–


✨ SYNOPSIS ✨

     bwcrop in.bw out.bw

     bwcrop in.bw out.bw inwidth outwidth outheight ulx uly urx ury lrx lry llx lly

two modes, pick your fighter 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: bwcrop grabs a quadrilateral region out of a bw(5) input file (in.bw) β€” and when we say arbitrarily large, we mean it, the input can be huge β€” then maps that region onto a specified output image size and writes the whole thing to out.bw. iconic behavior honestly πŸ”₯

if you only hand it the input and output files, bwcrop will just… ask you for the rest. interactively. like a conversation πŸ’¬ all your responses should be pixel counts or first-quadrant coordinates, bestie, don't get cute with it.

alternatively β€” and this is the main character move β€” you can put all the parameters right on the command line for use in scripts. slay πŸŽ€

the coordinate names refer to the input file, in clockwise order starting from the upper-left corner. and listen: the nearest input pixel gets selected for each output pixel. no interpolation. none. zero. we do not interpolate here πŸ’…


πŸ‘‘ ARGUMENTS πŸ‘‘

  • inwidth β€” width of the input image (that's the scanline length, iykyk).
  • outwidth, outheight β€” the dimensions of the output image. your canvas, your rules ✨
  • ulx, uly, urx, ury, lrx, lry, llx, lly β€” the coordinates that define the quadrilateral in the input image you wanna crop. they line up like this, respectively:
    • upper-left: ulx, uly
    • upper-right: urx, ury
    • lower-right: lrx, lry
    • lower-left: llx, lly

four corners, clockwise, no skipping 🧚


🌈 EXAMPLES 🌈

Example 1. cropping a tilted region from a 512x512 image into a 100x100 image

ok so picture this β€” a diamond, but make it a crop πŸ’Ž

$ bwcrop input.bw output.bw 512 100 100 256 512 512 256 256 0 0 256

this command extracts the diamond-shaped region bounded by (256, 512), (512, 256), (256, 0), and (0, 256) from the 512x512 input.bw image, and outputs it as a 100x100 rectangular image in output.bw. literally ate and left no crumbs πŸ“


πŸŽ€ SEE ALSO πŸŽ€

brlcad(1), bwrect(1), bwscale(1), bw(5)

(the whole friend group, go say hi πŸ’œ)


⭐ 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

ngl if you found a bug, tell them!! they wanna know!! don't suffer in silence bestie 😭

and that's the page!! brought to you by the BRL-CAD manual set, same energy as always πŸ’…βœ¨ go forth and crop responsibly, mwah 🫢

πŸ“¦ where this page comes from