Help, I burn, if someone has a ready-made solution, that when you click on the image, it will glow (transferred using the post method) and sepia overlay?
- 2In more detail, please describe the task. - terantul
- there is a picture, when you clicked on the mirror button , a mirrored same picture appeared - Goshka Tarasov
|
2 answers
Here is an example from the network:
$image = imagecreatefromjpeg("img.jpg"); $x = @imagesx($image); $y = @imagesy($image); $des = imagecreatetruecolor($x, $y); for ($i = 0; $i < $x; $i++) { for ($j = 0; $j < $y; $j++) { $color = imagecolorat($image, $i, $j); imagesetpixel($des, $x - $i - 1, $j, $color ); } } header("Content-Type: image/jpeg"); @imagejpeg($des); - Well, I understand this code will only work with jpeg? - Goshka Tarasov
- @ ngsh, and png and gif (first frame) and bmp and a few more, see help: php.net/manual/ru/ref.image.php and select the functions you need - jackrv
- By the way, the code provided does not work)) - Goshka Tarasov
- @ ngsh, but did not want to see why it does not work? Here is the original j290065.myjino.ru/img.jpg but what is in the code (I updated it) in the reply j290065.myjino.ru - jackrv
- Thanks, but I said that I was just learning, I understand what this code is about, but I don’t have enough brain to edit it, if it’s not difficult for you to help with this question - tarasik22.tmweb.ru/index.php/ eeeee / 1-test / detail / 1-car is a site that does, there is a mirror button - i.e. when pressed, it should be passed to the post in another file, and back, how to catch the variable, I understand, but how to send it? - Goshka Tarasov
|
and what is difficult ?? get a picture, read pixel by pixel (coordinates and color) in another canvas, mirror the coordinates and set the color - that's all
- this is all so simple for you, and I am still just learning, and for me it is difficult - Goshka Tarasov
|