pixels · odin · <1k loc

image inspector
for the terminal.

dimensions, format, size on disk, and an ascii histogram right in your shell. no gui, no browser tab, no python script that imports a 400mb library.

$ pixels photo.jpg

photo.jpg
  format     jpeg
  dimensions 40x30
  channels   3  (depth 8-bit)
  on disk    835 B

  lum 000-031  #####                      54
  lum 032-063  #############              143
  lum 064-095  #####################      228
  lum 096-127  ########################ᅠ  257
  lum 128-159  ######################    245
  lum 160-191  ################          177
  lum 192-223  ########                  95
  lum 224-255                            1
// capabilities

six modes. one binary.

01

default dump

dimensions, format, byte size, channels, bit depth. plus the luminance histogram.

02

--channels

split the histogram per r/g/b channel. useful for spotting a blown-out green.

03

--dominant N

top-N colors via a 4x4x4 rgb cube. not true k-means. about 30x faster. good enough for "what is this image mostly made of."

04

--ascii-preview

tiny unicode-shade preview. nearest-neighbor, luminance mapped to 10 shade chars. don't expect subpixel quality.

05

--json

machine-readable. pipe to jq. pixels a.png --json | jq .histogram.lum.

06

--batch

table view for a whole directory. pixels *.png --batch.

// formats

png, jpeg, bmp, tga, netpbm. whatever core:image ships. gif isn't in there yet, so pixels foo.gif errors out with an honest message instead of pretending. animated gifs would only read the first frame anyway. 16-bit images work by taking the high byte per channel.

// install
$ git clone https://github.com/f4rkh4d/pixels
$ cd pixels
$ odin build . -out:pixels -o:speed

binary drops in the repo root. move it wherever. tests via odin test tests/.