13.12.2012 Views

Re:TheAshLad - Sandbooks

Re:TheAshLad - Sandbooks

Re:TheAshLad - Sandbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(rand) xy. if (rand) x. if (rand) xy. xmax(x). ymax(y). xmin(xsizex).<br />

ymin(ysizey). imagestring(im maxp shade).<br />

imagepng(imdraw.maxp..png). imagepng(im). if (imgurl). draws an<br />

image based on blackwhite distribution in a source image. the overall.<br />

blackwhite distribution is reflected in each pixel each pixel is chosen<br />

as. black or white based statistically on the overall blackwhite<br />

distribution in. the source a very basic digital twobit markov chain<br />

algorithm. the image. will render noisy with different densities.. source<br />

image URL. use only blackwhitetwocolour png max x pixels using<br />

other pngs would. render the distribution of one colour against all the<br />

others so giving uneven. distribution blackwhite.. exit(). else. imurl<br />

imagecreatefrompng(imgurl). if (imurl) exit(Cannot create png image<br />

from URL). imurlx imagesx(imurl). imurly imagesy(imurl). if (imurlx<br />

or imurly ) exit(too big image max pixels width. and height.).<br />

header(Contenttype imagepng). imgurl. for (ii for (jj if<br />

(ImageColorAt(imurlij)). col. else. nocol. sum col nocol. generate img.<br />

xsizeysize. im imagecreate (xsize ysize). or die (Cannot Initialize new<br />

GD image stream). black imagecolorallocate (im). white<br />

imagecolorallocate (im). for (xx for (yy if (mtrand(sum)<br />

imagesetpixel(imxywhite). else. imagesetpixel(imxyblack).<br />

imagestring(im i green). imagepng(imdrawsum.png). imagepng(im).<br />

else. header(Contenttype imagepng). xsize. ysize. x(int)xsize.<br />

y(int)ysize. im imagecreate (xsize ysize). or die (Cannot Initialize new<br />

GD image stream). background imagecolorallocate (im). background<br />

imagecolorallocate (im)<br />

213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!