BWSHRINK(1)
π BWSHRINK(1) β shrink a black and white bw file, bestie π
β¨ NAME β¨
bwshrink β shrink a black and white bw file. Thatβs the whole gig. π
π SYNOPSIS π
bwshrink [-u] [-w _in_width_] [-n _in_height_] [-s _squaresize_] [-f _shrink_factor_] [_infile.bw_] > _outfile.bw_
π¦ DESCRIPTION π¦
okay so bwshrink reads a black and white bw(5) format file and produces a scaled-down version. It reads the entire image into memory and then scales it down to 1/factor of the original size in both dimensions. By default, bwshrink uses boxcar averaging to produce the output pixels. iconic behavior, honestly. β¨
π OPTIONS π
-uβ use pixel undersampling (nearest-neighbor decimation) instead of the default boxcar averaging. fast and a little chaotic, but valid. π¦-win_width β specify the input file width in pixels. the default is512. π-nin_height β specify the input file height (number of scanlines) in pixels. the default is512. π-ssquaresize β set both the input file width and height to the given size in pixels. one number, both dimensions, slay. π-fshrink_factor β set the integer scaling factor. must be greater than1. the default factor is2. π₯-h,-?β print a usage message and exit. your little help escape hatch. π
πΈ EXAMPLES πΈ
Example 1. Shrinking a 1024x1024 image
bwshrink -s 1024 -f 4 image.bw > image_small.bw
shrinks the 1024x1024 input file image.bw by a factor of 4, producing a 256x256 output file named image_small.bw using boxcar averaging. math ate, no cap. π
Example 2. Generating a thumbnail from a color render
pix-bw -e ntsc -w 2048 -n 1536 render.pix | bwshrink -w 2048 -n 1536 -f 8 -u > thumb.bw
converts a 2048x1536 color pix(5) render to grayscale with pix-bw(1), then pipes it to bwshrink to produce a 256x192 thumbnail. the -u flag selects fast nearest-neighbor undersampling instead of averaging. pipeline energy fr fr. π
π«Ά SEE ALSO π«Ά
brlcad(1), bwcrop(1), bwrect(1), bwscale(1), bw(5)
π BUGS π
bestie, listen: if the dimensions of the input image are not evenly divisible by the shrink factor, incorrect and bizarre output is generated. thatβs the warning. do with it what you will. π
π§ AUTHOR π§
BRL-CAD Team
β COPYRIGHT β
This software is Copyright (c) 1991-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
π cute little sign-off: source/version vibes are BRL-CAD, manual tag BWSHRINK(1), and the footer has no date listed. bye bestie, go shrink some bw files responsibly π
π¦ 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