BWCROP(1)
π 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
- upper-left:
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 π
π COPYRIGHT π
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
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms