Join the forums now, and start posting to receive access to our Scripts Vault!
<?if(isset($_POST['SubmitForm'])){ //setup Imagick $IMG = new Imagick(); $IMG->setFormat("gif"); //loop through possible files for($x=1; $x< ($_POST['hidden']+1); $x++) { if(!empty($_FILES['file' . $x]['tmp_name'])) { //add image to frame $frame = new Imagick($_FILES['file' . $x]['tmp_name']); $IMG->addImage($frame); //100 = 1s $IMG->setImageDelay($delay = 50); } }//rand name just for testing purposes$name = rand(1, 99999);$IMG->writeImages("$name.gif", true); // combine all image into one single image}?>
But isn't GIF 256 colour only format? You would need to use some advanced pallete selection algorithm (assuming the pictures are random colour non unified palette). I'm not sure software is capable of such things, it would rather require some skilled artist...
GIF creates a table of up to 256 colors from a pool of 16 million. If the image has fewer than 256 colors, GIF can render the image exactly. When the image contains many colors, software that creates the GIF uses any of several algorithms to approximate the colors in the image with the limited palette of 256 colors available. Better algorithms search the image to find an optimum set of 256 colors. Sometimes GIF uses the nearest color to represent each pixel, and sometimes it uses "error diffusion" to adjust the color of nearby pixels to correct for the error in each pixel.GIF achieves compression in two ways. First, it reduces the number of colors of color-rich images, thereby reducing the number of bits needed per pixel, as just described. Second, it replaces commonly occurring patterns (especially large areas of uniform color) with a short abbreviation: instead of storing "white, white, white, white, white," it stores "5 white."Thus, GIF is "lossless" only for images with 256 colors or less. For a rich, true color image, GIF may "lose" 99.998% of the colors.