PHPackages                             bigweb/img2text - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bigweb/img2text

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bigweb/img2text
===============

53201PHP

Since Nov 11Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dhlwing/img2text)[ Packagist](https://packagist.org/packages/bigweb/img2text)[ RSS](/packages/bigweb-img2text/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

img2text
========

[](#img2text)

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

See also [gif2text](https://github.com/dhlwing/gif2text)

Example
-------

[](#example)

[![](cat.jpg)](cat.jpg)

1. `img2text cat.jpg --color > with-color.html` [demo](http://dhlwing.github.io/img2text/color.html)
2. `img2text cat.jpg > without-color.html` [demo](http://dhlwing.github.io/img2text/nocolor.html)
3. `img2text cat.jpg --ansi`It would be like this: [![](example/ansi.png)](example/ansi.png)

Installation
------------

[](#installation)

```
$ composer require bigweb/img2text
```

Usage
-----

[](#usage)

```
Usage:
  img2text  [--maxLen=] [--fontSize=] [--color] [--ansi] [--bgcolor=]
  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=        sets font size (in pixels) when outputting HTML,
                        default: 7
  --maxLen=          resize image so that larger of width or height matches
                        maxLen, default: 100px
  --bgcolor=   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
------

[](#thanks)

1. Use  to create beautiful command-line interface
2. Use  to process image
3. Thanks @hit9, This project stolen from

License
-------

[](#license)

BSD.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/735770?v=4)[kong](/maintainers/dhlwing)[@dhlwing](https://github.com/dhlwing)

---

Top Contributors

[![dhlwing](https://avatars.githubusercontent.com/u/735770?v=4)](https://github.com/dhlwing "dhlwing (16 commits)")

### Embed Badge

![Health badge](/badges/bigweb-img2text/health.svg)

```
[![Health](https://phpackages.com/badges/bigweb-img2text/health.svg)](https://phpackages.com/packages/bigweb-img2text)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
