I have a JPEG template:
I need put a JPEG image inside that grey mask and save it as a JPEG. (so resize the jpeg, and put it where the greay mask is).
Is there a way to do that using php and imagemagick extension ?
Regards
I have a JPEG template:
I need put a JPEG image inside that grey mask and save it as a JPEG. (so resize the jpeg, and put it where the greay mask is).
Is there a way to do that using php and imagemagick extension ?
Regards
If you want your image to be 318px x 235px (to fit in the window of your template), you can resize using ImageMagick:
The
^
insures that the small version will not be any smaller than the given dimensions, although one dimension may be bigger, in order to maintain the aspect ratio.In order to insert the resized image into your template, you'll need a third image to serve as a mask. The mask is only black and white: the white is where you want the photo to show up in your template, like this:
Use the following line of code to create your composite image. The geometry indicates the offset in pixels (59 down and 15 over) to position the photo in the window: