Create and/or edit image with PHP

Asked

Viewed 1,464 times

1

You can edit images with PHP?

For example, place watermarks, or even make a "Paint" (with other languages together tbm, not just PHP).

OBS: I would like a solution without the use of frameworks.

1 answer

2


Yes, it is possible.

There are functions that crop and resize images: http://php.net/manual/en/function.imagecrop.php http://php.net/manual/en/function.imagecopyresized.php

But for more specific tasks, there is the GD library: http://php.net/manual/en/ref.image.php

See the example of the application of watermark d`in an image with GD: http://php.net/manual/en/image.examples.merged-watermark.php

Installing GD in your PHP: http://php.net/manual/en/image.installation.php

PHP is not limited to creating HTML output only. It can also be used to create and manipulate image files in a diversity formats including gif, png, jpg, wbmp, and xpm. And more conveniently, PHP can send image output streams directly to the browser. You will need to compile PHP with the GD library of function images for this to work. PHP and GD may also require other libraries, depending on the formats of images you want to work with. (PHP Handbook in EN)

I hope I’ve helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.