Coder Social home page Coder Social logo

phptextttr's Introduction

PHPTextTTR

PHP library to generate illusion image which can only be readable with tilted screen

How to use

  1. Run index.php to see a sample usage of this library
  2. Read comments in index.php to see how to properly use this library

Tips

  1. assets folder is library own folder in which frames and font is present.
  2. If you want to create your own frame then make the 4 versions of different dimensions of the same as you can see in assets/frames folder.
  3. You can completely modify it and use it in your own way.
  4. Feel free to contact me if you want any help regarding to this repo.
  5. You can also fork this repo and work on it and make pull request if you can make it more intresting.

Sample usage

You can find the same in index.php

  1. Include and initialize library
    require("./PHPTextTTR.php");
    $PHPTextTTR = new PHPTextTTR();
  1. Configure the object according to your needs
    // Both string cannot be more than 50 chracter length each
    // Second string is optional
    $PHPTextTTR->setText("Akansh Sirohi", "Creative Programmer");

    // Set font color and background color of image
    $PHPTextTTR->setColors("#000000", "#ffffff");

    // Use frames in image if set true
    $PHPTextTTR->setUseFrames(true);

    // if set true makes image embedable in image tags, default false
    $PHPTextTTR->setShowEmbed(true);
  1. You can embed it as image src in html after setting setShowEmbed to true
   <img src="<?= $PHPTextTTR->generateTTR(false); ?>" width="600">

OR

You can force download or show image diretly to page, use these after setting setShowEmbed to false

    $PHPTextTTR->generateTTR(false); // disabled force download
    $PHPTextTTR->generateTTR(true); // enabled force download

Example Image

Illusion Image

Happy Coding!

phptextttr's People

Contributors

akanshsirohi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.