Snippets

Footer for a picture or photo with ImageMagick

Snippets 20:09 / 05.07.2021

Recently in one of the chats a task on ImageMagick was discussed, which I found interesting, due to the fact that it was considered to be difficult and there were no ready similar solutions.

Briefly, the task was as follows: you need to write a script that will use ImageMagick to add a footer to a photo or image. And this footer should not overlap the original image, but be added at the bottom by the width of the processed image. The footer (black) should have a logo (static) and two labels (white) with the ability to choose any fonts for these labels.

I've never had any experience with ImageMagick for PHP before, as for my tasks I was satisfied with the capabilities of GD library. I wanted to solve this task, and with the ready solution I'm sharing in this publication.

1 872