Given a .gif, return the color components as X11-style hexadecimal specifiers (or equivalents)

view full story

http://unix.stackexchange.com – I am a fan of potrace, and I recently read the Potrace FAQ. The FAQ includes this beautiful one-liner: cat img.gif | giftopnm | ppmcolormask #641b1b | potrace The command I am looking for would return the codes of all the colors to be parsed by ppmcolormask. It could return, according to man ppmcolormask: You can specify color five ways: o An X11-style color name (e.g. black). o An X11-style hexadecimal specifier: rgb:r/g/b, where r g and b are each 1- to 4-digit hexadecimal numbers. o An X11-style decimal specifier: rgbi:r/g/b, where r g and b (HowTos)