PHPackages                             xander/text-image - 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. [Image &amp; Media](/categories/media)
4. /
5. xander/text-image

ActiveLibrary[Image &amp; Media](/categories/media)

xander/text-image
=================

Text to Images

v1.1.3(3y ago)012MITPHPPHP ^7.4

Since Nov 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ChinaXander/TextToImg)[ Packagist](https://packagist.org/packages/xander/text-image)[ RSS](/packages/xander-text-image/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (6)DependenciesVersions (8)Used By (0)

#### 文字生成图片

[](#文字生成图片)

```
$text2 = '擦拭法阿 法狗奥撒个 恩噶 as 噶阿锋age啊 aggage gqaegeag 阿法狗啊 aqegaeg dgageegea gaegaegaeaeya 阿发个哥恩爱狗';
$text1 = 'a778cfad你好';
$text = 'STM32F429BIT6SD1GS1G531G31G5E1GA31G5AG
TPS548B28RWWR
TPS2546RTER。
ADC128D818CIMTX/noPB
TPS650942A0RSKR
LM74700QDBVRQ1
LMR36006FSC3RNXTQ1
LP8866QRHBRQ1
SN74LVC257ARGYR
TLV76750DRVR';
( new TextToImg( $text, $img ?? null ) )
    ->createImage( 500, 400 )//创建500X400的空白图片
    //->setOption( 'font_size', 14 )//字体设置
    ->setOption( 'line_space', 10 )//行间距
    ->setOption( 'start_width', 30 )//左边距
    ->setOption( 'font_max_width', 480 )//字体最大宽度
    ->appendText( $text2 )//追加文本
    ->customBr()// 自定义分段 ， 默认 \r\n
    ->customBr( '/' ) // 自定义使用 / 分段
    ->toImages()//执行转图片操作
    ->show();//浏览器输出

//图片处理，转为圆形，并等比例缩放至120px
$avatar = 'https://taoic.oss-cn-hangzhou.aliyuncs.com/wx_mini/1/minivcardwxfile://tmp_2afa494e0556ccd35e50d5afce87eb15a95460c1ea62fb7d.png';
$tmpImg = ( new Images( $avatar ) )->circle()->scale( 120 );
$tmpImg->show();//输出到浏览器
$tmpImg->buffer();//返回图片的buffer格式
$tmpImg->base64();//返回图片的base64格式
$tmpImg->base64ToPng();//返回图片的base64 png格式
$tmpImg->save('test.png');//保存至本地
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~4 days

Total

7

Last Release

1243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8802f0e7f34553ef9ae20f6be11705fcca46e90b94a76000e3fec292fc1d8dae?d=identicon)[ChinaXander](/maintainers/ChinaXander)

### Embed Badge

![Health badge](/badges/xander-text-image/health.svg)

```
[![Health](https://phpackages.com/badges/xander-text-image/health.svg)](https://phpackages.com/packages/xander-text-image)
```

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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