PIXSHRINK(1)

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

πŸ’… PIXSHRINK(1) β€” the pixshrink page, bestie edition ✨

okay so real talk, this is the manual page for pixshrink from the BRL-CAD fam, and it's genuinely one of the most useful little gremlins in the toolbox. let's get into it 🫢


🌸 NAME 🌸

pixshrink β€” shrink a color pix file by an integer factor

like, exactly what it says on the tin, no cap πŸ’–


✨ SYNOPSIS ✨

pixshrink [-u] [-w in_width] [-n in_height] [-s squaresize] [-f shrink_factor] [infile.pix] > outfile.pix

she takes a pix, she makes it smol, she sends it out. iconic behavior honestly πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so pixshrink reads a color pix(5) format image of given dimensions and produces a smaller, scaled-down version of it. the output gets reduced by an integer shrink_factor in both dimensions, which lowkey makes pixshrink the logical opposite of pixinterp2x(1). they're giving enemies-to-lovers, iykyk 😭

input is read from infile.pix if you give it one β€” otherwise she'll read from standard input. the shrunk image goes to standard output. simple as that, bestie πŸ’…

the input width and height (in pixels) are specified with -w and -n. both default to 512 when you don't say anything, which is a whole vibe. here's the thing though: the entire image is read into memory, and then scaled. so don't come at her with a gigapixel file and expect magic πŸ™ˆ

by default pixshrink uses boxcar averaging β€” each output pixel is computed as the average of a shrink_factor by shrink_factor block of input pixels. that's the pretty, smooth, well-behaved option. the -u option instead selects faster undersampling (point sampling), which is exactly as unbothered and chaotic as it sounds ⭐


πŸ’– OPTIONS πŸ’–

  • -w in_width β€” set the input image width in pixels (default 512). she needs to know how wide you are 🌈
  • -n in_height β€” set the input image height in scan lines (default 512). how tall, bestie? πŸ“
  • -s squaresize β€” set both the input width and height to squaresize pixels (shorthand for a square image). one number, two dimensions, efficiency queen πŸ‘‘
  • -f shrink_factor β€” set the integer scaling factor (default 2). each output dimension becomes 1/shrink_factor of the input. must be greater than 1 β€” so 1 is not the move, and neither is 0, don't even try it πŸ’€
  • -u β€” use image undersampling (point sampling) rather than the default boxcar averaging. faster, rougher, main character energy πŸ”₯
  • -h, -? β€” print a usage message and exit. the classic "help me help you" combo 🫢

πŸ“ EXAMPLES πŸ“

Example 1. Halve a 1024x1024 image

pixshrink -s 1024 image.pix > thumb.pix

reads a 1024x1024 pix(5) image and writes a 512x512 version using the default shrink factor of 2 and boxcar averaging. half the pixels, all the slay ✨

Example 2. Generate a quarter-size thumbnail and view it

pixshrink -w 1280 -n 720 -f 4 render.pix | pix-fb -w 320 -n 180

shrinks a 1280x720 rendering down to 320x180 (that's a factor of 4, mwah) and pipes the result straight to pix-fb(1) for a quick preview on the framebuffer β€” without writing an intermediate file. the way that pipe just works πŸ˜­πŸ’œ


πŸ’€ BUGS πŸ’€

bestie. listen. if the input dimensions are not evenly divisible by the shrink_factor, incorrect or garbled output is produced. not "a little off", not "slightly cursed" β€” garbled. so do your math before you run her, fr fr πŸ™ˆ


🌟 SEE ALSO 🌟

brlcad(1), pixinterp2x(1), pixscale(1), pixcrop(1), pixrect(1), pix-fb(1), pix(5)

the whole friend group, honestly β€” go say hi πŸ¦‹


🧚 AUTHOR 🧚

BRL-CAD Team


this software is Copyright (c) 1990-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


okay that's the whole page, bestie β€” go shrink something pretty πŸ’…βœ¨ and yeah, this was the pixshrink page from the BRL-CAD crew (version vibes courtesy of the BRL-CAD source/distribution, dated right there in the 1990-2026 copyright window). mwah, bye πŸ«ΆπŸ’–

πŸ“¦ where this page comes from