In the study of the PHP GD Library, found a section of the code written by others, here to hope to increase everyone's enthusiasm for PHP. This code is a mosaic of the character's avatar and looks interesting.
function Pixelfuck ($url, $chars = ' ewk34543§g§$§ $Tg 34g4g ', $shrpns =1, $size =4, $weight =2) { list ($w, $h, $type) = GetImageSize ($url); $resource = imagecreatefromstring (file_get_contents ($url)); $img = Imagecreatetruecolor ($w * $size, $h * $size); $CC = strlen ($chars); for ($y =0; $y < $h; $y + + $shrpns) for ($x =0; $x < $w; $x + = $shrpns) imagestring ($img, $weight, $x * $size, $y *$ Size, $chars {@++ $p% $cc}, Imagecolorat ($resource, $x, $y)); return $img;} $url = ' http://upload.wikimedia.org/wikipedia/commons/b/be/Manga_Icon.png '; $text = ' I-dont-like-manga-...- Why-do-they-have-such-big-eyes? Strange-...-what-want-you-do? '; Header (' content-type:image/png '); Imagepng (Pixelfuck ($url, $text, 1, 6));
The next one is the original image, and one is the processed image.