Jump to content

What's Faster 1 big image or lots of small using GD


cooldude832

Recommended Posts

I'm generating a dynamic map off mysql and it will be a sort of 10x10 grid that is composed of different images (like grass, trees, sand, mountains, lake etc etc) My question is would it be better to use the gd library to generate each map look (it changes on every page load) using GD to link each of the smaller images (48x40 pngs) to 1 big (480x400) png and then only displaying that one image.  Or would it be better to just query out and display them straight from the query doing it 100 times (10 by 10 grid) showing 100 images.

its not 100 queries the query is the same in both case

 

$q = "select x,y,type from `map` where x>=$minx && $x <=$maxx && y>=$miny && y<$maxy";

 

but then after it is queried it has a while loop

while ($row = mysql_fetch_assoc($result){

Options here.

 

I can paste together the whole map if i sort my query by Y then X and then simply "grow" the big image out or i can do a multi array

$map[]['x] = $row['x'];

$map[]['y'] = $row['y'];

$map[]['type'] = $row['type'];

 

 

and then echo it out as a table later down?  First version would require lots of GD, (but could be done via na extenral file, the second requires no GD but spalshes out 100 images and must echo out a 10x10 table.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.