承接 bigweb/img2text 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bigweb/img2text

Composer 安装命令:

composer require bigweb/img2text

包简介

README 文档

README

Image to Ascii Text, can output to html or ansi terminal.

See also gif2text

Example

  1. img2text cat.jpg --color > with-color.html demo
  2. img2text cat.jpg > without-color.html demo
  3. img2text cat.jpg --ansi It would be like this:

Installation

$ composer require bigweb/img2text

Usage

Usage:
  img2text <imgfile> [--maxLen=<n>] [--fontSize=<n>] [--color] [--ansi] [--bgcolor=<#RRGGBB>]
  img2text (-h | --help)

Options:
  -h --help             show this screen.
  --ansi                output an ANSI rendering of the image
  --color               output a colored HTML rendering of the image.
  --fontSize=<n>        sets font size (in pixels) when outputting HTML,
                        default: 7
  --maxLen=<n>          resize image so that larger of width or height matches
                        maxLen, default: 100px
  --bgcolor=<#RRGGBB>   if specified, is blended with transparent pixels to
                        produce the output. In ansi case, if no bgcolor set, a
                        fully transparent pixel is not drawn at all, partially
                        transparent pixels drawn as if opaque

You also can use it anywhere what you want at your application like this:

use Bigweb\Img2text\Img2text;

$options = [
        'ansi'     => ,
        'color'    => 1,
        'fontSize' => 7,
        'maxLen'   => 100,
    ];
$img = new Img2text('imageFilePath', $options);
echo $img->render();

Thanks

  1. Use https://github.com/docopt/docopt.php to create beautiful command-line interface
  2. Use https://github.com/Intervention/image to process image
  3. Thanks @hit9, This project stolen from https://github.com/hit9/img2txt

License

BSD.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-11-09