如何将cacaview的结果输出到文件中?

时间:2018-09-06 15:25:09

标签: linux

我知道如何使用cacaview查看图像文件。我想将结果保存在文本文件中。这可能吗?

1 个答案:

答案 0 :(得分:1)

您不能使用cacaview,必须使用img2txt,它是libcaca的一部分,请尝试如下操作:

img2txt -W 80 -f ansi ./image.png > image.txt

有关更多信息,请查看帮助:

img2txt -h

输出:

  -h, --help            This help
  -v, --version         Version of the program
  -W, --width=WIDTH     Width of resulting image
  -H, --height=HEIGHT       Height of resulting image
  -x, --font-width=WIDTH        Width of output font
  -y, --font-height=HEIGHT      Height of output font
  -b, --brightness=BRIGHTNESS   Brightness of resulting image
  -c, --contrast=CONTRAST   Contrast of resulting image
  -g, --gamma=GAMMA     Gamma of resulting image
  -d, --dither=DITHER       Dithering algorithm to use :
            none: no dithering
            ordered2: 2x2 ordered dithering
            ordered4: 4x4 ordered dithering
            ordered8: 8x8 ordered dithering
            random: random dithering
            fstein: Floyd-Steinberg dithering
  -f, --format=FORMAT       Format of the resulting image :
            caca: native libcaca format
            ansi: ANSI
            utf8: UTF-8 with ANSI escape codes
            utf8cr: UTF-8 with ANSI escape codes and MS-DOS \r
            html: HTML
            html3: backwards-compatible HTML
            bbfr: BBCode (French)
            irc: IRC with mIRC colours
            ps: PostScript document
            svg: SVG vector image
            tga: TGA image
            troff: troff source