setBackgroundColor(new ImagickPixel('#ffffff')); $image->readImageBlob(file_get_contents($icon_path)); $image->setImageFormat("png24"); $image->setImageInterpolateMethod('Integer'); $image->resizeImage(180, 180, Imagick::FILTER_POINT, 1); $image->borderImage('#ffffff', 510, 225); $image->writeImage($preview_path); } // generate color palette $palette = array(); $svg = file_get_contents($icon_path); preg_match_all("/#([0-9a-fA-F]{6})/", $svg, $matches); $palette = array_unique($matches[0]); $palette = array_map('strtoupper', $palette); // get tags $icon_json = json_decode(file_get_contents(__DIR__ . "/icons.json"), true); $tags = $icon_json[$icon_name . ".svg"]; ?> <?= $icon_name ?> - Pixel Icons

Colour Palette:
Colour code copied!
Tags: