Login   Register  
PHP Classes
elePHPant
Icontem

File: example_script.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2009-04-24 14:42
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(70200);
    
$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(400200);
    
$image->resizeCanvas(500500);
    
$image->dumpToBrowser();
?>