PIXCOLORS(1)

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

πŸ’… PIXCOLORS(1) β€” the BRL-CAD one where we count colors πŸ’–

okay so bestie, this is the manual page for pixcolors from BRL-CAD, and it's genuinely one of the most satisfying little tools ever β€” like a vibe check for your image's palette. let's get into it ✨


🌈 NAME 🌈

pixcolors β€” count or list the distinct colors used in a pix image 🎨


🫢 SYNOPSIS 🫢

pixcolors [-v] [file.pix]

✨ DESCRIPTION ✨

okay so here's the tea: pixcolors reads a pix(5) format image and writes to standard output the number of distinct color values it contains. that's it, that's the whole personality πŸ’…

Where does the image come from? From the named file.pix, or from standard input if no file is given β€” so you can absolutely pipe into it, and honestly you should, it's giving main character energy πŸŽ€

Every single pixel gets treated as a 24-bit RGB value, so the count ranges from 1 all the way up to 16,777,216. yes, sixteen million, she's got range πŸ‘‘


πŸ¦‹ OPTIONS πŸ¦‹

  • -v β€” Verbose. Not only does it print the color count, it also prints a sorted list of every unique color used, one per line, as three decimal R G B component values. it's the difference between "cool, some colors" and "here is the entire receipt" 🧾✨

🌸 EXAMPLES 🌸

Example 1. List the unique colors in a region of an image

pixrect -s 512 -w 64 -n 64 -x 100 -y 100 frame.pix | pixcolors -v

So what's happening here πŸ‘€ β€” pixrect(1) extracts a 64x64 tile from a 512-line image, and then it's piped straight into pixcolors to print the count followed by every distinct R G B triple in that tile. why do we care? because it's so useful for checking whether an area is a flat color or a gradient, and honestly that's the kind of intel that changes your whole day πŸ•΅οΈβ€β™€οΈπŸ’–


πŸ‘€ SEE ALSO πŸ‘€

brlcad(1), pixrect(1), pixhist(1), pixstat(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 πŸ“§

ngl if something's weird, just email them β€” they're nice, and a good bug report is honestly a slay πŸ’…

and that's the whole page bestie πŸŽ€ shoutout to BRL-CAD for shipping pixcolors(1) β€” go count some colors, you're gonna ate it πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from