Dividing an image up so it looks like it is made up of a lot of smaller photos.
Output
Input
<?php /* Note: Some care needs using on how to divide the image as sometimes a small image is created that causes a problem. */
// If the form has been submitted do this if ( $Submit ) {
// Temporary upload image name $image = $_FILES['filename']['tmp_name'];
// Get the image dimensions $size=GetImageSize( $original_image );
// Name to save the image as - in this case the same as the original $new_image = $_FILES['filename']['name'];
// Amount of images in x $qty_x = $_POST['x'];
// Amount of images in y $qty_y = $_POST['y'];
// Get the size of the original image $size = getimagesize($image);
// Size to crop the images to $crop_x = round( $size[0]/$qty_x); $crop_y = round( $size[1]/$qty_y);
// Canvas for combined images - it will be trimmed to the finished image size in the code $width = ( $size[0] * 1.5 ); $height = ( $size[1] *1.5 );
// Crop the image system("convert $image -crop {$crop_x}x{$crop_y} image-%d.jpg");
// Remove the .jpg from the filenames foreach (glob("*.jpg") as $filename) { $file = str_replace('.jpg', '', $filename ); system("convert $filename -background black +polaroid $file.png"); }