digitalkreativ/php-simple-gif-transitions

Create an animated gif that displays a simple transition between one image and another image of the same size

v0.0.3-alpha 2017-10-02 19:40 UTC

This package is auto-updated.

Last update: 2024-05-05 17:47:32 UTC


README

This class will help you generate an animated gif that transitions from one image (jpg) to another image (jpg).

Both images will have to be of the same size.

Installation

    composer require digitalkreativ/php-simple-gif-transitions

Example

<?php

try {
    $config = new \Digitalkreativ\SimpleGifTransitions\Library\Config();

    $config->setTempDirectory( '<full-path-to-tmp-dir>' )
        ->setDebug( true )
        ->setImageDriver( \Digitalkreativ\SimpleGifTransitions\Library\Config::IMAGE_DRIVER_GD );


    $generator = new \Digitalkreativ\SimpleGifTransitions\GifGenerator( $config );
    $generator->setScenario( new \Digitalkreativ\SimpleGifTransitions\Scenarios\RevealSlideBottom() );
    $generator->setFromImage( '<full-path-to-jpg>'  )
        ->setToImage( '<full-path-to-jpg>' )
        ->generate( '<full-path-to-jpg-to-generate>' );

} catch ( Exception $ex ){
    echo $ex->getMessage() . PHP_EOL;
}

Components used

License

The MIT License (MIT). Please see License File for more information.