Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add dynamically frames to images

On a web server running PHP I have images like that:

enter image description here

To which I have to add frames like that: enter image description here

I think it's quite complex, because images won't have the same ration (width/height), there is a shadow on the Mat which can be modified to change the color or can be removed.

I know how to play with php image GD library and I could easily add some watermarks on images but I don't know which tool I should use to generate dynamically a frame.

Maybe ImageMagick or I was thinking about Gimp bach mode. Which tool would you advise me?

like image 596
London Smith Avatar asked May 24 '26 01:05

London Smith


1 Answers

Yes you can do it with Imagemagick: https://www.imagemagick.org/Usage/thumbnails/#frame_edge

You just need to do the calculations and use them to create the dimensions etc. from the original image.

It gets quite complicated to work out at the start.

EDIT: This has a smaller shadow on the matt ( my personal preference ) but I did it with Imagemagick and php ( note Stackoverflow has changed it to a jpg so it has lost the background transparency ):

enter image description here

like image 196
Bonzo Avatar answered May 26 '26 13:05

Bonzo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!