PIXAUTOSIZE(1)

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

πŸ’… 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 πŸ”₯

  • -b bytes_per_sample β€” number of bytes used per sample (pixel). must be a positive integer. defaults to 3 ⭐
  • -f file_name β€” determine the size from the length of the named file. mutually exclusive with -l πŸ¦‹
  • -l file_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

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