cl-image2text
所属分类:内容生成
开发工具:Common Lisp
文件大小:5236KB
下载次数:0
上传日期:2020-08-05 14:36:56
上 传 者:
sh-1993
说明: 一个图像到文本的转换器,用Common Lisp编写。
(An image-to-text converter, written in Common Lisp.)
文件列表:
LICENSE (1070, 2020-08-05)
algorithm.lisp (13982, 2020-08-05)
buffers.lisp (4969, 2020-08-05)
cl-image2text.asd (837, 2020-08-05)
constants.lisp (4053, 2020-08-05)
conversion.lisp (5350, 2020-08-05)
io.lisp (5536, 2020-08-05)
package.lisp (553, 2020-08-05)
pics (0, 2020-08-05)
pics\example.png (4955184, 2020-08-05)
pics\example_result.png (364010, 2020-08-05)
pics\lisplogo_fancy_256.png (42286, 2020-08-05)
roswell (0, 2020-08-05)
roswell\image2text.ros (3637, 2020-08-05)
version.sexp (6, 2020-08-05)
# cl-image2text
*image2text* is an image-to-text converter, written in Common Lisp.
![Alien technology](https://github.com/ivanp7/cl-image2text/blob/master/pics/lisplogo_fancy_256.png)
Resulting text uses `^[[38;2;R;G;Bm` and `^[[48;2;R;G;Bm` ANSI true color codes
and Unicode block characters.
## Installation
1. Install [Roswell](https://github.com/ivanp7/cl-image2text/blob/master/https://github.com/roswell/roswell) to your system.
If you use Arch-based Linux distro, there is a package available in AUR: [roswell](https://github.com/ivanp7/cl-image2text/blob/master/https://aur.archlinux.org/packages/roswell/).
2. Install *image2text*:
```sh
$ ros install ivanp7/cl-image2text
```
## Usage
Run program with
```sh
$ ros exec image2text OPTIONS
```
If you add `$HOME/.roswell/bin` to your `$PATH`,
you won't need to call Roswell explicitly:
```sh
$ image2text OPTIONS
```
For usage help, run
```sh
$ ros exec image2text --help
```
```
Usage: image2text [-h|--help] [-v|--version] [-x|--columns WIDTH]
[-y|--rows HEIGHT] [-r|--keep-ratio] [-f|--format FORMAT] [FILE]
Available options:
-h, --help show usage help
-v, --version show version
-x, --columns WIDTH width of output text
-y, --rows HEIGHT height of output text
-r, --keep-ratio keep aspect ratio of image
-f, --format FORMAT type of input image
If FILE is omitted, image is read from the standard input.
In this case, --format option is mandatory.
Supported image formats:
GIF, PPM, PGM, PBM, PNG, JPG, JPEG, TIF, TIFF
```
## Advanced usage
Modify `conversion.lisp` to change the set of characters used for convertion.
See `define-conversion` documentation for details.
## Example
Converting an image
![Example image](https://github.com/ivanp7/cl-image2text/blob/master/pics/example.png)
with command
```sh
$ ros exec image2text -x 319 -y 85 -r example.png
```
and 2x4 `braille` conversion yields the following result:
![Example result](https://github.com/ivanp7/cl-image2text/blob/master/pics/example_result.png)
## Author
Ivan Podmazov (ivanpzv8@gmail.com)
## [License](https://github.com/ivanp7/cl-image2text/blob/master/LICENSE)
近期下载者:
相关文件:
收藏者: