How do I place curved text over image in Imagick?


Is there a way to place curved text over an image using Imagick? I have the following code which creates a coloured background as an image and places text over it, then the whole thing is curved but if I were to replace the plain bg with an image, the image is distorted.

How do I keep the image intact but only curve the text?

header("Content-Type: image/png");
        $draw = new ImagickDraw();


        $textOnly = new Imagick();
        $textOnly->newImage(600, 300, "rgb(17, 255, 0)");
        $textOnly->annotateImage($draw, 30, 40, 0, 'Your Text Here');
        $textOnly->setImagePage($textOnly->getimageWidth(), $textOnly->getimageheight(), 0, 0);

        $distort = array(180);

        $textOnly->distortImage(Imagick::DISTORTION_ARC, $distort, false);

        echo $textOnly->getimageblob();

Source: Laravel

Categorised as imagick, laravel, php Tagged , ,


Leave a Reply

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us