BW-PNG(1)

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

🌸 NAME 🌸

okay bestie, meet bw-png from the BRL-CAD manual: it converts a BRL-CAD BW format image into a PNG (Portable Network Graphics) format image. it's giving glow-up for grayscale files, fr fr πŸ’…βœ¨


✨ SYNOPSIS ✨

    bw-png [-a] [-w _file_width_] [-n _file_height_] [-s _squaresize_] [_file.bw_] > _file.png_

πŸ¦‹ DESCRIPTION πŸ¦‹

so bw-png converts a BRL-CAD bw(5) format file (one unsigned byte per pixel) to a png(5) format file written to standard output. the result is a grayscale image with a bit depth of 8. iconic, honestly πŸŽ€

if file.bw is not specified, the image is read from standard input. by default the input is assumed to be 512x512 pixels; this can be overridden with the size options. lowkey important: the output is rejected if standard output is a terminal 🫢

bestie, that terminal rejection is not a vibe check you can charm your way out of β€” it literally rejects the output there πŸ’€

πŸ’… OPTIONS πŸ’…

  • -a β€” autosize the input, deriving the width and height from the file size. only effective when reading from a named file rather than standard input. no cap, it needs an actual file name to do its thing ✨
  • -w file_width β€” set the width of the input to file_width pixels.
  • -n file_height β€” set the height of the input to file_height scanlines.
  • -s squaresize β€” set both the width and the height of the input to squaresize pixels. square era πŸŽ€
  • -h, -? β€” print a usage message and exit. cute little help moment 🫢

🌈 EXAMPLES 🌈

πŸ“ Example 1. Convert a 1024x1024 BW image to PNG

        $ bw-png -s 1024 image.bw > image.png

converts the 1024x1024 BRL-CAD BW image file image.bw to a PNG image file named image.png. slay, that's the whole flex πŸ’–

🧚 Example 2. Render a model and save it as a PNG

        $ rt -s 1024 -o model.bw model.g component.r
        $ bw-png -s 1024 model.bw > model.png

ray-traces a region into a 1024x1024 grayscale bw(5) file with rt(1), then converts it to a viewable png(5) image. main character pipeline energy, honestly πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

brlcad(1), png-bw(1), bw-pix(1), pix-png(1), rt(1), bw(5), png(5)


πŸŽ€ AUTHOR πŸŽ€

BRL-CAD Team


This software is Copyright (c) 1998-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 bw-png(1) page, bestie β€” source/version: BRL-CAD, manual page: bw-png(1), and date: not listed on this page, so i'm not inventing one, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from