Off Topic > Off Topic
Dynamic loveUAL PHP INTERCOURSE Images
BobSevenSevens:
Make a map of the USA out of 0's,1's, and random lines, Matrix style.
Void:
I know very little php, but why dont you write a script that generates curves and swirls instead of just skewing, straight lines?
Azimuth:
--- Quote from: BobSevenSevens on July 21, 2009, 04:05:26 PM ---Make a map of the USA out of 0's,1's, and random lines, Matrix style.
--- End quote ---
I'm sure its possible but I can't do it right now, maids will be working in my room soon, and it's taking too long to execute.
--- Code: ---<?php
$fake = ImageCreateFromJPEG("america-map.jpg");
$real = ImageCreate(ImagesX($fake),ImagesY($fake));
$trans = ImageColorAllocateAlpha($real,0,0,0,127);
ImageFill($fake,0,0,$trans);
for($i=0;$i<=ImagesX($fake);$i+=4)
{
for($j=0;$j<=ImagesY($fake);$i+=6)
{
$col = ImageColorAt($fake,$i,$j);
$r = $col >> 16;
$g = $col >> 8;
$b = $col;
$new = ImageColorAllocate($real,$r,$g,$b);
ImageChar($real,1,$i,$j,rand(0,1),$new);
}
}
header("Content-type: image/png");
ImagePNG($real);
ImageDestroy($fake);
ImageDestroy($real);
?>
--- End code ---
It takes so long it doesn't even reach an error I just fixed.
--- Quote from: Void on July 21, 2009, 04:11:34 PM ---I know very little php, but why dont you write a script that generates curves and swirls instead of just skewing, straight lines?
--- End quote ---
I'll try that soon.