Skip to content

Instantly share code, notes, and snippets.

@symisc
Last active March 23, 2021 01:32
Show Gist options
  • Save symisc/d94e92abf5979f4c82d80990dbd698c1 to your computer and use it in GitHub Desktop.
Save symisc/d94e92abf5979f4c82d80990dbd698c1 to your computer and use it in GitHub Desktop.
Generate a GIF file from a set of static image using the PixLab API - https://pixlab.io/cmd?id=makegif
<?php
/*
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github
* https://github.com/symisc/pixlab-php
*/
require_once "pixlab.php";
# Generate GIF from a set of static image - https://pixlab.io/cmd?id=makegif
$key = 'PIXLAB_API_KEY'; # # Your PixLab API Key. Get yours from https://pixlab.io/dashboard
# Process
$pix = new Pixlab($key);
if( !$pix->post('makegif',array('frames' => [
["img" => "https://cdn1.iconfinder.com/data/icons/human-6/48/266-512.png"],
["img" => "https://cdn1.iconfinder.com/data/icons/human-6/48/267-512.png"],
["img" => "https://cdn1.iconfinder.com/data/icons/human-6/48/278-512.png"],
["img" => "https://cdn1.iconfinder.com/data/icons/human-6/48/279-512.png"]
])) ){
echo $pix->get_error_message()."\n";
die;
}
echo "GIF Link: ".$pix->json->link."\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment