Note, image size is not used for all canvas types. Some have a single set size e.g. rose, logo.
Note, image size is not used for all canvas types. Some have a single set size e.g. rose, logo.
Canvas type
Note, image size is not used for all canvas types. Some have a single set size e.g. rose, logo.
//return [
//    "GRANITE:" => "Granite",
//    "LOGO:" => "Logo",
//    "NETSCAPE:" => "Netscape web safe colors",
//    "WIZARD:" => "Wizard",
//    "canvas:khaki" => "Canvas constant",
//    "xc:wheat" => "Canvas constant shorthand",
//    "rose:" => "Rose",
//    "gradient:" => "Gradient",
//    "gradient:black-fuchsia" => "Gradient with color",
//    "radial-gradient:" => "Radial gradient",
//    "radial-gradient:red-blue" => "Radial gradient with color",
//    "plasma:" => "Plasma",
//    "plasma:tomato-steelblue" => "Plasma with color",
//    "plasma:fractal" => "Plasma fractal",
//    "pattern:hexagons" => "Hexagons",
//    "pattern:checkerboard" => "Checkerboard",
//    "pattern:leftshingle" => "Left shingle",
//];

function newPseudoImage($canvasType)
{
    $imagick = new \Imagick();
    $imagick->newPseudoImage(300, 300, $canvasType);
    $imagick->setImageFormat("png");
    header("Content-Type: image/png");
    echo $imagick->getImageBlob();
}