.gifが与えられると、カラーコンポーネントはX11スタイルの16進指定子(またはそれに対応する値)として返されます。

.gifが与えられると、カラーコンポーネントはX11スタイルの16進指定子(またはそれに対応する値)として返されます。

私はのファンpotraceで、最近読んだ。フォートレースのよくある質問

FAQには次のような美しい内容が含まれています。

cat img.gif | giftopnm | ppmcolormask #641b1b | potrace

私が探しているコマンドは、解析されるすべての色のコードを返しますppmcolormask。によると、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  are
          floating point numbers between 0 and 1.

   o      For  backwards  compatibility, an old-X11-style hexadecimal num‐
          ber: #rgb, #rrggbb, #rrrgggbbb, or #rrrrggggbbbb.

   o      For backwards compatibility, a triplet of numbers  separated  by
          commas:  r,g,b,  where  r  g  and  b  are floating point numbers
          between 0 and 1.  (This style was added before MIT came up  with
          the similar rgbi style.)

ベストアンサー1

cat foo.gif | giftopnm | ppmhist -noheader -hexcolors | awk '{ print "rgb:"$1"/"$2"/"$3 }'

X11 rgb:r/g/b 形式のすべてのカラーリストを提供します。

おすすめ記事