<?php function Thumbnail($url, $width = 64, $height = 64) { // download and create gd image $image = file_get_contents($url); $img = new Imagick(); $img->readImageBlob($image); $img->scaleImage($width,$height); echo $img->getImageBlob(); } header("content-type: image/jpeg"); Thumbnail("https://thispersondoesnotexist.com/image#.jpg", 64, 64); ?>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter