PIXSCALE(1)
π 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. π-ssquareinsize β set both the input width and input height to squareinsize pixels. one number, both dimensions, square energy. π-winwidth β set the input file width in pixels (default512).-ninheight β set the input file height (number of scan lines) in pixels (default512).-Ssquareoutsize β set both the output width and output height to squareoutsize pixels. matching-set energy for the output side. β¨-Woutwidth β set the output file width in pixels (default512).-Noutheight β set the output file height (number of scan lines) in pixels (default512).
π 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. π«‘
π 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
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
- 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