niwa3836 Posted November 26, 2008 Share Posted November 26, 2008 Hi all, Have tried to find a solution to this but dont seem to be able too. I am "sure" something must exist to do it, but wood for the trees and all that. Basically I am happy creating good old 100x100 PNG files. What I would like to be able to do is either from file, or in memory join a number of these to make 1 PNG file 500x500 (i.e. 5 x 5 PNG pictures in a single PNG). Anyone know how? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/134421-png-graphics-help-please/ Share on other sites More sharing options...
ratcateme Posted November 26, 2008 Share Posted November 26, 2008 check out the GD library it has all the functions you need. Scott. Quote Link to comment https://forums.phpfreaks.com/topic/134421-png-graphics-help-please/#findComment-699821 Share on other sites More sharing options...
niwa3836 Posted November 26, 2008 Author Share Posted November 26, 2008 Must be tired, but tried a number of the GD functions prior will keep looking on my own unless someone knows! Quote Link to comment https://forums.phpfreaks.com/topic/134421-png-graphics-help-please/#findComment-699828 Share on other sites More sharing options...
ratcateme Posted November 26, 2008 Share Posted November 26, 2008 here is a exmaple <?php $output = imagecreatetruecolor(500,500); for($x = 0; $x < 500 $x+=100){ for($y = 0; $y < 500 $y+=100){ $import = imagecreatefrompng("images/" . ($x/100) . "." . ($y/100) . ".png"); imagecopyresampled($output,$import,$x,$y,0,0,100,100,100,100); } } header('Content-Type: image/png'); imagepng($output); ?> the images folder has images named 1.0.png then 1.1.png the follow the form (x cord).(y cord).png Scott. Quote Link to comment https://forums.phpfreaks.com/topic/134421-png-graphics-help-please/#findComment-699838 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.