R
R
Roma2017-07-28 14:17:19
PHP
Roma, 2017-07-28 14:17:19

How to make a shadow for an image in PHP?

Hello everyone !!=) People there is such a picture
eae04713f7dd4f1f8f5a4974d6ff786d.jpg
Make like this
bcab63d5be9c460a8196bfde6dc4711f.jpg
I managed to do like this
a04d9445b8ab480393ee1bc98f27d614.jpg
But how to add shadows to these pictures ???
I am attaching the code I wrote.

$dest = imagecreatefromjpeg('result.jpg');
$src = imagecreatefromjpeg('thumb_l_28550.jpg');
$resultImg='res.jpg';

imagecopymerge($dest, $src, 20, 190, 20, 190, 150, 170, 100);
imagecopymerge($dest, $src, 178, 127, 178, 127, 150, 300, 100);
imagecopymerge($dest, $src, 336, 23, 336, 23, 150, 500, 100);
imagecopymerge($dest, $src, 495, 127, 495, 127, 150, 300, 100);
imagecopymerge($dest, $src, 653, 190, 653, 190, 150, 170, 100);
header('Content-Type: image/jpg');
imagejpeg($dest,$resultImg);

I will be very grateful =)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Viktor Yanyshev, 2017-07-28
@B_Roma

I suppose to cut the main image into the number of images you need, save as separate images and separately add shadows, then create an empty image of the desired size and place all the necessary images in it. And all this using php.

A
Alexander, 2017-07-28
@zkelo

Shadows are made with CSS. Here's a utility to make things easier: link .

A
Alexander Aksentiev, 2017-07-28
@Sanasol

In general, no way.
1. Make the template ready with a bottom layer
2. Use external editors https
://stackoverflow.com/questions/7288173/how-ca...
on php in any way dynamically.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question