Giter Site home page Giter Site logo

image-creator's Introduction

ImageCreator

ImageCreator is a PHP class that allows you to create and manipulate images. This class can create images, add backgrounds, text, and stickers, and then output the final image in various formats.

Requirements

  • PHP 7.4 or higher
  • GD Library with FreeType support enabled

Installation

  1. Clone this repository or download the CmdImage.php file.
  2. Ensure that the GD library with FreeType support is enabled in your PHP installation. You can check this by running phpinfo(); and looking for the GD section.

Usage

  1. Create a new PHP file, e.g., index.php.
  2. Include the CmdImage.php file.
  3. Use the CmdImage class to create and manipulate your image.

Example

Create an index.php file with the following content:

<?php
require 'CmdImage.php';

// Instantiate the CmdImage class
$image = new CmdImage();

// Create a new image object with specified dimensions
$image->createImageObject(1080, 1080);

// Fill the background with a random light color
$image->createBackgroundRandomLight();

// Add a background image with specified opacity
$image->addBackground('./linux.jpg', 50);

// Add text with specified parameters
$image->addText("sudo ls -a make me happy with click on windows", 50, 'C:\Windows\Fonts\arial.ttf', [0, 200, 0], [0, 0, 0, 63], 20);

// Add a sticker image to the main image
$image->addSticker('./sticker.png');

// Output the final image as a JPEG file
$image->returnImage('jpeg');
?>

image-creator's People

Watchers

Mohammad Tafakori 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.