BWSHRINK(1)

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

πŸ’… 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. πŸ¦‹
  • -w in_width β€” specify the input file width in pixels. the default is 512. πŸ“
  • -n in_height β€” specify the input file height (number of scanlines) in pixels. the default is 512. πŸ“
  • -s squaresize β€” set both the input file width and height to the given size in pixels. one number, both dimensions, slay. πŸŽ€
  • -f shrink_factor β€” set the integer scaling factor. must be greater than 1. the default factor is 2. πŸ”₯
  • -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

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