PIXHALVE(1)
๐ PIXHALVE โ the pixhalve(1) glow-up
okay bestie, so pixhalve is a little BRL-CAD icon and honestly? it's giving shrink ray โจ her whole job is to take a color pix file and make it literally half the size in each direction. that's it. that's the gig. ๐
โจ NAME โจ
pixhalve โ reduce the resolution of a color pix file by one half ๐ฆ
๐ธ SYNOPSIS ๐ธ
pixhalve [-a] [-s squaresize] [-w file_width] [-n file_height] [file.pix] > outfile.pix
๐ DESCRIPTION ๐
so pixhalve reads a color pix(5) image and writes out a brand new pix(5) image that's at one half the resolution in each direction โ which means the output has one quarter as many pixels. math girlie behavior, we love to see it. ๐งฎโจ
and here's the tea: because this tool is mainly used to prep imagery for NTSC television, it doesn't just yeet pixels. no ma'am. it converts RGB to YUV first, then applies a 3x3 pyramid filter to the luminance (Y) channel and a 5x5 pyramid filter to the chrominance (U and V) channels โ and then it downsamples. obsessed with the attention to detail, lowkey. ๐
input is read from file.pix if you give her one, otherwise she takes it from standard input. and the result? always written to standard output. no cap. ๐
now, the input width must be known so scanlines can be split correctly โ that's just how it is, bestie. the width defaults to 512 pixels, and you can set it with -w, or with -s (for square images), or let her detect it automatically from a named file with -a. the image height? doesn't even need to be specified, because input is processed until end of file. main character energy: she just keeps going till there's nothing left. ๐๐ฅ
๐ OPTIONS ๐
-aโ autosize the input by reading the dimensions right from the named file. she needs a file argument for this one, and it has no effect on piped input (sorry, pipe girlies ๐). it also disables autosizing... wait, no, it is the autosizing. it's the autosize option, periodt. โจ-ssquaresize โ set both the input width and (nominally) the height to squaresize pixels, for square images. disables autosizing. ๐ช-wfile_width โ set the input scanline width to file_width pixels (default 512). disables autosizing. ๐-nfile_height โ accepted for compatibility and to disable autosizing. the height value itself is ignored, because input is consumed until end of file. it's decorative. it's a vibe. it's not doing anything. ๐
๐ฆ EXAMPLES ๐ฆ
Example 1. Downsample a rendered frame for NTSC preview
rt -o frame.pix -w 1024 -n 1024 model.g component &&
pixhalve -s 1024 frame.pix | pix-fb -w 512 -n 512
renders a 1024x1024 image with rt(1), halves it down to 512x512 with that NTSC-tuned YUV filtering, and displays the result on a framebuffer with pix-fb(1). the full pipeline ate and left no crumbs. ๐ฅ
Example 2. Halve a file twice for a quarter-size thumbnail
pixhalve -a big.pix | pixhalve -w 256 > quarter.pix
autosizes the first pass straight from the file header, producing a half-size intermediate, then halves again โ so the final image is one quarter of the original width (e.g. 1024 to 256). double halving, double slay. ๐โจ
๐ SEE ALSO ๐
brlcad(1), pixcrop(1), pixrect(1), pixinterp2x(1), pixscale(1), pix-fb(1), pix(5)
๐ AUTHOR ๐
BRL-CAD Team โ kings, honestly. ๐ซถ
๐ธ COPYRIGHT ๐ธ
this software is Copyright (c) 1991-2026 by the United States Government as represented by U.S. Army Research Laboratory. iconic and legally protected. ๐
๐ BUG REPORTS ๐
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org โ tell them the group chat sent you. ๐ง๐
ok that's the whole page bestie, go forth and halve some pixels โจ๐ฆ
BRL-CAD, pixhalve(1) โ signed off with love, and dated however the original footer said so ๐๐ (it's the BRL-CAD release, you already knew that ๐)
๐ฆ 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