I need to manipulate images on the server-side via PHP. I use ImageMagick for that purpose, and there are a lot of great functions, but no documentation...
The issue is the next:
I have two images a png with a transparent background, and a jpg one;
I need to change the JPG image that has the same shape as the visible part of the PNG.
I don't want to crop the image, but to adjust to the PNG's visible part. Is that possible to do?
Example:
Ive a script to generate an image using imagemagick in PHP, after designing i need to create a pdf to print and this pdf need to be like a vector one, even if we zoom in the content should be crisp, but my pdf is not so, can some one guide me how to achieve this?
Do i need to convert my final png as svg? or is it possible to make pdf with PNG as vector?
I need some help with re-sizing an original high resolution image to a smaller image for security through an easier function.
I already have used the function file_get_contents( $image ) before I INSERTed it into MYSQL with LONG BLOB format.
Now, I am able to display those images with given dimensions through the height and width attributes of the HTML tag, now that displayed images are downloadable (i.e. savable through right click & save image option) with their original size.
So, I need to use a function to change the dimension of that image before display. Is there any possibility to keep the image as a thumbnail?
I don't want to keep two images (one for thumbnail and other for the downloadable image in the database).
Have you looked PHPs GD library?
imagecopyresampled is one of the functions you could use
So far, I've been uploading one image by hand (FTP to the server when live, locally moving a file), and then resizing them on the fly using the img tag's width and height properties to resize them. Well, the images don't look good, because I need a square, cropped 100px version as a thumbnail, and then a 800px wide version for the view image page, and then finally the full-size original image for HD viewing, but I also need to apply a watermark, but only to the full res version. And I need help with an image upload script. Any sort of file upload, really. I've looked at tutorials, and they don't seem to make too much sense. Furthermore, I need to drop all three versions into a database row (which I think I can figure out). I know that I need to use something like $_FILE to do it, but I'm just really confused to the actual usage and the cropping/resizing/watermarking part really has me stumped. Solutions, anyone?
File uploading
Upload using a simple HTML form and use PHP to manipulate the image. Example
Read all the images stored in a directory and convert them in a batch. Example
Image re-sizing
Use ImageMagick or GD library to resize images. Example
Use any of the same libraries to watermark the images. Example
In all, you need to combine all these in order to upload, resize and watermark all in one go.
For the resizing, watermark etc, you should look at ImageMagic
I get poor image quality when trying to generate image using PHP GD. Here is the code http://paste2.org/p/1220178 I use it to convert a bunch of files into a merged/thumb images file.
Use imagecopyresampled() instead of imagecopyresized().