PIXAUTOSIZE(1)
π PIXAUTOSIZE(1) β the BRL-CAD one, section 1, bestie β¨
okay so picture this: you've got an image file and you're like "how big is this actually" and it's giving mystery. that's literally what pixautosize is for. welcome π«Ά
β¨ NAME β¨
pixautosize β guess the width and height of a standard-size image file π
πΈ SYNOPSIS πΈ
pixautosize [-b bytes_per_sample] [-f file_name | -l file_length]
π DESCRIPTION π
so pixautosize determines whether a file is one of the "standard" image sizes recognized by the BRL-CAD framebuffer library β literally the same sizes that the -a (autosize) option of pix-fb(1) accepts. iconic behavior tbh π
when a standard size is matched, it prints an assignment string that's suitable for evaluation in a Bourne shell sh(1) script, like this:
WIDTH=512; HEIGHT=512
the image is selected either by name with -f or by byte count with -l β exactly one of the two must be given. specifying both? that's an error, no cap π
the number of bytes per sample (pixel) defaults to 3, which is the correct value for pix(5) files. use -b 1 for bw(5) files, and -b 24 for dpix files (that's three channels of 8-byte double samples, in case you were wondering).
and if no standard size matches? a diagnostic gets printed to standard error, WIDTH=0; HEIGHT=0 gets printed to standard output, and a non-zero exit status is returned. vibe check: failed π
π₯ OPTIONS π₯
-bbytes_per_sample β number of bytes used per sample (pixel). must be a positive integer. defaults to3β-ffile_name β determine the size from the length of the named file. mutually exclusive with-lπ¦-lfile_length β determine the size from an explicit file length in bytes. must be a positive integer. mutually exclusive with-fπ-h,-?β print a usage message and exit. the classic escape hatch π
π EXAMPLES π
Example 1. Size a pix file by name and capture the result in a shell script
eval `pixautosize -f scene.pix` # sets WIDTH and HEIGHT
pix-fb -w $WIDTH -n $HEIGHT scene.pix
the first line evaluates the WIDTH=...; HEIGHT=... string emitted by pixautosize, which populates the shell variables β slay. the second line uses those variables to display the image with pix-fb(1). chef's kiss π
Example 2. Size a bw file from a known byte count
pixautosize -b 1 -l 2500
this reports WIDTH=50; HEIGHT=50 for a single-channel bw(5) image of 2500 bytes. and the equivalent three-channel pix(5) image would be sized with pixautosize -b 3 -l 7500. math is mathing π§
β SEE ALSO β
brlcad(1), pix-fb(1), bw(5), pix(5), sh(1)
π AUTHOR π
BRL-CAD Team
π COPYRIGHT π
This software is Copyright (c) 1992-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
and that's the whole page, bestie β brought to you by BRL-CAD, section 1 of the manual, PIXAUTOSIZE(1). go size some images fr fr π¦β¨
π¦ 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