PHP Classes

File: example_script.php

Recommend this page to a friend!
  Classes of Abbey Sparrow  >  Image Booth  >  example_script.php  >  Download  
File: example_script.php
Role: Example script
Content type: text/plain
Description: example script
Class: Image Booth
Manipulate images split in layers
Author: By
Last change:
Date: 13 years ago
Size: 864 bytes
 

Contents

Class file image Download
<?php
   
require('./ImageBooth.php');
   
   
$raw_image = imagecreatefromjpeg('./captcha.jpg');
   
$overlay_image = imagecreatefrompng('./captcha2.png');
   
$checks = imagecreatefrompng('./checks.png');
   
$image = ImageBooth::newImage(70, 200);
   
$image->newLayer($raw_image, 'base');
   
$image->newLayer($checks, 'checks');
   
$image->newLayer($overlay_image, 'overlay');
   
$image->filter('blur', array('amount'=>'400'));
   
$image->operate('color_replace', array('origin_color'=>'333388', 'destination_color'=>'CC0000'));
   
$image->operate('brightness_contrast', array('brightness_adjustment'=>-20, 'contrast_adjustment'=>20));
   
$image->operate('negative');
   
$image->selectLayer('checks');
   
$image->transform('rotate', array('angle'=>15));
   
$image->resize(400, 200);
   
$image->resizeCanvas(500, 500);
   
$image->dumpToBrowser();
?>