PIXCOLORS(1)
π 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 decimalR G Bcomponent 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 π
Β©οΈ COPYRIGHT Β©οΈ
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
- 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