PIXEMBED(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… pixembed(1) β€” a BRL-CAD moment ✨

okay bestie so real talk, this is pixembed from the BRL-CAD fam, and it's literally the glow-up tool for your pix images πŸŽ€


✨ NAME ✨

pixembed β€” embeds a pix image inside a bigger frame by replicating the border pixels outward (no boring black padding here, we ate πŸ’…)


🌸 SYNOPSIS 🌸

pixembed [-b border_inset] [-s squareinsize] [-w inwidth] [-n inheight]
         [-S squareoutsize] [-W outwidth] [-N outheight] [in.pix] > out.pix

πŸ¦‹ DESCRIPTION πŸ¦‹

So pixembed reads a 3-byte/pixel RGB pix(5) image and centers it inside a larger output pix(5) image. and instead of just slapping black in the margin like some kind of amateur, it replicates the boundary pixels of the input outward to fill the whole entire margin. no cap, it's giving mirror-core πŸͺžβœ¨

okay so here's the tea: the extreme edge pixels of an image are sometimes noisy or degraded 😭 so you can bump up the border_inset and the replicated color gets sampled from a row or column slightly inside the actual edge of the input. lowkey genius.

if you don't hand it an in.pix, it reads the image from standard input β€” and the embedded result always goes to standard output, no exceptions bestie. both input and output dimensions default to 512x512 πŸ’–

⚠️ the rules: the output size must be greater than or equal to the input size, and the border inset must be smaller than the input width. them's the vibes, don't fight them.

πŸ’… OPTIONS πŸ’…

  • -b border_inset β€” the inset, in pixels, from the actual image edge where the replicated border color gets sampled. default is 0, meaning the exact edge pixels get replicated. iykyk 🫢
  • -s squareinsize β€” sets both the width and the height of the input image to squareinsize pixels. one number, two jobs, main character energy πŸ‘‘
  • -w inwidth β€” sets the width of the input image to inwidth pixels (default 512).
  • -n inheight β€” sets the height of the input image to inheight pixels (default 512).
  • -S squareoutsize β€” sets both the width and the height of the output image to squareoutsize pixels.
  • -W outwidth β€” sets the width of the output image to outwidth pixels (default 512).
  • -N outheight β€” sets the height of the output image to outheight pixels (default 512).

🌈 EXAMPLES 🌈

Example 1. Embed a 512x512 image into a 1024x1024 frame

pixembed -s 512 -S 1024 < input.pix > output.pix

this centers the 512x512 input inside a 1024x1024 image, replicating the input's edge pixels to fill the surrounding border, then writes the bigger image to output.pix. slay πŸŽ€

Example 2. Generate a clean matte for compositing

pixembed -w 640 -n 480 -W 800 -N 600 -b 4 render.pix | pix-png -w 800 -n 600 > matte.png

this one embeds a 640x480 render into an 800x600 frame, sampling the border color from 4 pixels inside the edge to dodge those noisy outer rows πŸ™ˆ, and then pipes the whole thing straight into pix-png(1) to produce a PNG ready for compositing. iconic behavior fr fr πŸ”₯


🧚 SEE ALSO 🧚

brlcad(1), pixscale(1), pixmatte(1), pixbustup(1), pix-png(1), pix(5)


⭐ AUTHOR ⭐

BRL-CAD Team πŸ’œ


This software is Copyright (c) 1989-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 β€” yes bestie, actual email, go tell them everything 🫢


and that's the whole page!! brought to you by the BRL-CAD girlies β€” BRL-CAD, no cap, catch you in the next group chat πŸ˜­πŸ’–βœ¨

πŸ“¦ where this page comes from