galvin Posted November 24, 2008 Share Posted November 24, 2008 If a user uploads, say, NINE jpeg images to my server, can I use PHP to then create ONE large jpeg image that contains all nine of those images? In other words, say each individually uploaded file was 100 x 100 pixels. I would want to create ONE larger image that is 300 pixels wide by 300 pixels high and combines all nine smaller images (in a 3 by 3 grid essentially). Picture a Tic-Tac-Toe board as being the final single large Image with each individual smaller image being in one of the sections of the Tic-Tac-Toe board. Is this process of combining multiple images into ONE image possible with PHP? Quote Link to comment https://forums.phpfreaks.com/topic/133960-multiple-images-into-one-large-image-using-php/ Share on other sites More sharing options...
DeanWhitehouse Posted November 24, 2008 Share Posted November 24, 2008 Yes, look at image gd functions Quote Link to comment https://forums.phpfreaks.com/topic/133960-multiple-images-into-one-large-image-using-php/#findComment-697347 Share on other sites More sharing options...
galvin Posted November 24, 2008 Author Share Posted November 24, 2008 Ok, thanks. I don't see anything about MULTIPLE images though. Can you give me any insight on how to create an image from MULTIPLE images. I imagine I would have to use the function imagecreatefromjpeg() but is it OK to put more than one souurce file as a parameter? Quote Link to comment https://forums.phpfreaks.com/topic/133960-multiple-images-into-one-large-image-using-php/#findComment-697357 Share on other sites More sharing options...
DeanWhitehouse Posted November 24, 2008 Share Posted November 24, 2008 There is no pre-built function for it, you need to learn how to use image GD functions. You could always use CSS/HTML to just visibly merge the images on the page. Quote Link to comment https://forums.phpfreaks.com/topic/133960-multiple-images-into-one-large-image-using-php/#findComment-698003 Share on other sites More sharing options...
.josh Posted November 24, 2008 Share Posted November 24, 2008 if you google php watermarking, you should find what you need. It's mostly the same principle. Quote Link to comment https://forums.phpfreaks.com/topic/133960-multiple-images-into-one-large-image-using-php/#findComment-698013 Share on other sites More sharing options...
Garethp Posted November 24, 2008 Share Posted November 24, 2008 use a for or while loop and imagecopymerge to combine them all Quote Link to comment https://forums.phpfreaks.com/topic/133960-multiple-images-into-one-large-image-using-php/#findComment-698014 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.