Ok, I must have something wrong in mine. Here is how I did it:
<?php
$new_head = $_GET['new_head'];
// File and rotation
$filename = 'test.jpg';
$degrees = $new_head;
// Content type
header('Content-type: image/jpeg');
// Load both images
$source = imagecreatefromjpeg($filename);
$insert = imagecreatefromjpeg("test2.jpg");
//background color for base image
$white = imagecolorallocate($source,255,255,255);
//make overlay image transparent
imagecolortransparent($insert,imagecolorat($insert,0,0));
// Rotate both images
$rotate_overlay = imagerotate($insert, -10, $white);
$rotate = imagerotate($source, $degrees, $white);
//get size of overlay
$insert_x = imagesx($insert);
$insert_y = imagesy($insert);
//set the transparent color of the overlay image
imagecolortransparent($rotate_overlay,imagecolorat($insert,0,0));
//merge images, and output the final image
imagecopymerge($rotate,$rotate_overlay,0,0,0,0,$insert_x,$insert_y,100);
imagejpeg($rotate,"",100);
?>
If I change "$insert_x = imagesx($insert); " to "$insert_x = imagesx($insert) - imagesx($rotate_overlay))/2;" (and same with the y), the image does not show up at all. Did I go about doing this all wrong? Just trying to learn some new stuff. Thanks!