PIXSCALE(1)

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

πŸ’… pixscale(1) β€” the BRL-CAD glow-up page

okay so you found the pixscale manual page, bestie, and honestly? it's a whole vibe. this is the BRL-CAD tool that resizes your .pix images. let's get into it πŸŽ€


✨ NAME ✨

pixscale β€” change the size of a color pix file. that's it. that's the job. slay.


🌸 SYNOPSIS 🌸

pixscale [-r] [-s squareinsize] [-w inwidth] [-n inheight] [-S squareoutsize] [-W outwidth] [-N outheight] [in.pix] > out.pix

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” pixscale reads a color pix(5) format file that has some given dimensions, and writes a larger or smaller scaled version to standard output. that's the whole main character move.

if you don't hand it an input file, it just reads from standard input instead. no biggie, she's flexible like that. πŸ’β€β™€οΈ

both the input and output dimensions default to 512x512 pixels for any dimension you didn't explicitly specify. so if you're lazy about it (we've all been there), she assumes 512. periodt.

now the algorithm β€” this is the part where she's actually lowkey a genius:

  • when scaling up, it's bilinear interpolation ✨
  • when scaling down, it's a box filter of arbitrary size

the box filter makes a "square pixel" assumption, meaning all whole and fractional input pixels that fall into a rectangle the size of an output pixel contribute according to the fraction of the output pixel area they cover. like, everybody gets their proportional say. very democratic of her. πŸ—³οΈ

when interpolating, the edge pixels are preserved β€” i.e. all interpolated pixels fall inside the edges. no pixel escapes the boundary. ngl, that's boundaries done right. 🫢

⚠️ important vibe check: this program cannot scale up in one dimension while scaling down in the other. she will not be doing that. pick a lane.

and if you're specifically doing 2X interpolation, there's a much faster alternative: pixinterp2x(1). like, way faster. use that instead, iykyk. πŸ”₯


πŸ’– OPTIONS πŸ’–

  • -r β€” use nearest neighbor interpolation (pixel replication) instead of bilinear interpolation when scaling up. crisp, sharp, no blur β€” for when you want those crunchy pixels. πŸ‘‘
  • -s squareinsize β€” set both the input width and input height to squareinsize pixels. one number, both dimensions, square energy. πŸŽ€
  • -w inwidth β€” set the input file width in pixels (default 512).
  • -n inheight β€” set the input file height (number of scan lines) in pixels (default 512).
  • -S squareoutsize β€” set both the output width and output height to squareoutsize pixels. matching-set energy for the output side. ✨
  • -W outwidth β€” set the output file width in pixels (default 512).
  • -N outheight β€” set the output file height (number of scan lines) in pixels (default 512).

🌈 EXAMPLES 🌈

Example 1. Generate a thumbnail

pixscale -w 1024 -n 768 -W 128 -N 96 image.pix > thumb.pix

reads a 1024x768 color pix(5) image and produces a 128x96 thumbnail using the box filter, preserving the 4:3 aspect ratio. cute AND proportional πŸ’…

Example 2. Double an image with crisp pixels

pixscale -r -s 256 -S 512 image.pix | pix-png > big.png

reads a 256x256 image and doubles it to 512x512 using nearest neighbor replication (sharp edges, no blurring), then pipes the result through pix-png(1) to create a PNG. the pipe? iconic. the sharpness? immaculate. 🫢✨


🧚 SEE ALSO 🧚

brlcad(1), pixcrop(1), pixrect(1), pixinterp2x(1), pix(5)


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” the collective. the squad. the people. 🫑


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


okay that's the whole thing!! you're basically a pixscale expert now, no cap πŸ’œ this lil masterpiece came to you from BRL-CAD with the date range 1989-2026 up there in the fine print β€” go forth and resize something gorgeous, bestie πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from