Location: PHPKode > scripts > GD Image Manipulation > gd-image-manipulation/example.php
<?php
/* Example file for ImageManipulation.class.php
 *
 * This is GDImageManipulation in action.
 * It loads the test-png (300.png), does a few operations on
 * it, saves it as jpeg and for your convenience, loads it
 * into this page.
 *
 * See the upcoming documentation for details.
 *
 *
 */
?>
<?php

require_once('GDImageManipulation.class.php');
$filename="300.png";

$imageManipulation = new GDImageManipulation();
$imageManipulation->set_image_asFile($filename);

$imageManipulation->fit_width('250', true);
$imageManipulation->convert_sepia();
$imageManipulation->convert_brightness(10);
$imageManipulation->convert_contrast(10);
$imageManipulation->convert_mean_removal();
$imageManipulation->convert_smooth(50);
$imageManipulation->rotate(45, 255, 255, 255);

$imageManipulation->save_jpeg('300.jpg',true);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

<html>

   <head> 
      <title>Untitled</title>
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
    <img src="300.png" />
    <img src="300.jpg" />

   </body>
</html>
Return current item: GD Image Manipulation