PIXHALVE(1)

๐Ÿ“ฆ
version 7.44.0 ยท 2 versions
, in nixpkgs unstable

๐Ÿ’… 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. โœจ
  • -s squaresize โ€” set both the input width and (nominally) the height to squaresize pixels, for square images. disables autosizing. ๐ŸŸช
  • -w file_width โ€” set the input scanline width to file_width pixels (default 512). disables autosizing. ๐Ÿ“
  • -n file_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. ๐Ÿซถ


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