首页 > 解决方案 > 如何将cacaview的结果输出到文件中?

问题描述

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

标签: linux

解决方案


你不能使用 cacaview,你必须使用 libcacaimg2txt的一部分,试试这样:

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

推荐阅读