<?php namespace abeautifulsite; use Exception; require '../src/abeautifulsite/SimpleImage.php'; if (!is_dir('processed/')) { mkdir('processed/'); } try { // // WARNING: This will create a lot of images in the /processed folder // $img = new SimpleImage(); // Create from scratch $img->create(200, 100, '#08c')->save('processed/create-from-scratch.png'); // Convert to GIF $img->load('butterfly.jpg')->save('processed/butterfly-convert-to-gif.gif'); // Strip exif data (just load and save) $img->load('butterfly.jpg')->save('processed/butterfly-strip-exif.jpg'); // Flip horizontal $img->load('butterfly.jpg')->flip('x')->save('processed/butterfly-flip-horizontal.jpg'); // Flip vertical $img->load('butterfly.jpg')->flip('y')->save('processed/butterfly-flip-vertical.jpg'); // Flip both $img->load('butterfly.jpg')->flip('x')->flip('y')->save('processed/butterfly-flip-both.jpg'); // Rotate 90 $img->load('butterfly.jpg')->rotate(90)->save('processed/butterfly-rotate-90.jpg'); // Auto-orient $img->load('butterfly.jpg')->auto_orient()->save('processed/butterfly-auto-orient.jpg'); // Resize