You can use the gd ( manual ) functions for this.
Download the original image ( imagecreatefromstring() can be useful, so you do not need to specify the type of image), create an output image ( imagecreatetruecolor() ) and use imagecopy() (if you do not use, you want to resize it). In the end, use imagepng() to output the image or save it to a file.
We will warn you that gd does not use image compression in memory, so it may take a lot of RAM to create a PHP mosaic when creating a PHP process. Use imagefree() as soon as possible.
svens source share