Skip to content

Simple text-to-image in PHP. Converts text into an image with dynamic height. Endless capabilities.

Notifications You must be signed in to change notification settings

LuoXianMin/text-to-image-php

Repository files navigation

Text-to-image converter

Takes a string and converts it into an image. The script adds line breaks to the string and dynamically adjusts the height depending on the number of lines.


In this project:

This project contains the text-to-image.php and

  • A web demo using the text-to-image.php: text-to-image-demo.php
  • Another demo that adjusts color, art, figures in the image: art-generator.php
  • An example use--display an email address as an image--under email-example/

How to use:

Include:

include 'text-to-image.php';

Pass a string through the function:

$string = 'Pass strings like this or from a form using POST';
$image = new image;
$image->makeImageFromString($string);

The result will look something like this:


art-generator.php Demo

Capabilities

Can be used to create reCAPTCHA-esque images for spam prevention, generate unique images for users, store display user emails in a photo to prevent spammers from obtaining this information, and so on.

Install

Install by cloning: `git clone [email protected]:harmankang/text-to-image-php.git`

Run

I will not put this in the readme, so google "How to run PHP scripts on my computer." It takes less than 5 minutes to set up.

Open in browser and enjoy!

About

Simple text-to-image in PHP. Converts text into an image with dynamic height. Endless capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages