Command Line

Documentation / CyPix

Command Line

cypix is a worker, not a window. Most day-to-day use is from CyWall Apply, CyFiler thumbnails, or a one-liner you type. Pictures are PPM on the wire; PNG, screenshots, and SGI .rgb go through a converter first, or use the built-in paths that already decode for you (--wallpaper, --grab, --thumb).

convert shot.png ppm:- | cypix - --at 10,10

Look At The Pixels

Add-ons for the strip readers:

Compare Against A Reference

cypix compare REF.ppm OURS.ppm [--align] [--diff OUT.ppm]

Measures how far OURS drifts from REF in dE76: overall mean and max, plus the worst-diverging grid cells so you can see WHERE icons or widgets differ. --align searches a +-8px offset (and runs automatically when the sizes differ). --diff writes divergent pixels magenta over a dimmed REF. Use '-' for stdin on either path.

Scheme From A Wallpaper

cypix wall.ppm --scheme --name 'Ice Castle'
cypix wall.ppm --scheme --name 'Ice Castle' --out FILE --explain

Reads the picture, finds the colours it is really made of, and writes a .cyscheme that sits with it. --out saves the file; --explain prints the working.

Make A Palette

Harmonies: complementary, triadic, tetradic, analogous, split-complementary. Default print is hex; --fmt ppm writes a swatch strip; --out FILE saves. A harmony may return fewer than N colours.

Set The Root Wallpaper

What CyWall Apply and the filer backdrop run:

cypix --wallpaper FILE
cypix --wallpaper --place fill|stretch|scale|center|tile FILE
cypix --wallpaper --size WxH --bg RRGGBB FILE

Decodes FILE (any format libcyicon reads), smooth-scales to the root (or --size), then publishes the root pixmap (_XROOTPMAP_ID / ESETROOT_PMAP_ID). --dry-run --out out.ppm writes the scaled image without touching X.

Take A Screenshot

cypix --grab
cypix --grab -o shot.png
cypix --grab window
cypix --grab --id 0x2000003
cypix --grab --rect X,Y,W,H
cypix --grab --delay 3 -o menu.png

Whole screen, a clicked window, a named window id, or a rectangle. --delay waits so you can open a menu first. Output is .png or .ppm from the -o name; -o - sends PPM on stdout so a grab can pipe straight into --at, --diff, or --scheme. No ImageMagick, scrot, or libpng required. Windows are read off the screen as your eyes see them, including whatever covers them.

Check Your Work

Thumbnails For The File Manager

cypix --thumb [--size N] [--report] [--force] [-v] FILE...

Writes a small preview of each FILE into a .cycache folder beside it. CyFiler forks this; you rarely run it by hand. --size is the edge in pixels (default 96). --report prints OK per file. --force redraws even when the cache looks current. -v narrates.

cypix --flat-check FILE [--fuzz N] [--frac F]

Is this frame mostly solid black or white? cythumb-video.sh uses it to reject blank mplayer dumps. Exit 0 = has content, 1 = flat, 2 = error.

Line Art To IconSmith FTI

cypix --trace-fti IN.jpg [-o OUT.fti] [--thresh 145] [--grid 100]

Dark pixels become outlinecolor bgnline strokes; white stays transparent. For dumpster-style B&W icons. --thresh is the 0..255 ink cutoff; --grid is 16..200 (100 is the IconSmith square). Without -o/--out, the .fti lands beside you as IN's basename.

Examples

convert shot.png ppm:- | cypix - --col 110:0-40 --vs 4080c0
convert emerald-mountain.rgb ppm:- | cypix - --scheme --name 'Emerald Mountain'
cypix --palette 12 --from 396375 | cypix --checkpalette -
cypix --trace-fti dumpster_closed.jpg -o share/cyicon/Dumpster.closed.fti

See Also

Cyanotype Project. Blueprint Desktop. BSD 2-clause. Not affiliated with Silicon Graphics. SGI, IRIX, and Indigo Magic belong to their owners. 1.0 is aimed at 31 October 2026.