Mask/Merge an image to another image in PHP GD - php

I have a requirement I need to merge/mask an image to its cover image. please see below pics
Cover image- (png mask)
Customer Photo
Final Image
Is this possible in PHP GD? Finally it should generate a single image.
Thanks!

Related

Checking if Thumbnail and Full Image are a match in PHP

I have a large database with images. Problem is, quite some images have the wrong thumbnail, so I need to confirm that they match.
I want to compare the thumbnail and full size image with each other, and come up with a percentage that they match.
The thumbnails & full images do not have exactly the same dimensions.
The full images are PNG's with transparent backgrounds, and the thumbnails have a grey/white grid as a background.
What is the best way to see if a thumbnail & full image match?
Example of how a full image & thumbnail look.
I found & tried: https://github.com/kennethrapp/phasher but this gets thrown off by the grid background in the thumbnails.
I had nearly the same problem and my solution was that I compare the timestamp of the full size image with the one of the thumb. If the thumb is older, then a new full size image was uploaded and my system creates a new thumb (and also clears the according cache).

PHP image manipulation wrapping image on of another image

I'm working on a PHP project where the user can upload an image and preview that image on a product (Ex. mug, pillow). I have done almost all that is required to implement this except wrapping the uploaded image around the product image. I have done extensive search on that, but could not find any help. Could anyone show me the way please ?
At the moment I am using the GD library.
Best example for what I need is : http://www.zazzle.com/polyester_throw_pillow_16_x_16-189271445174968378
I am not sure how they are doing that.
EDIT :
My area of interest is how they are blending the image according the product shape
I think it's answered here: Merge two PNG images with PHP GD library
Just make sure that the image uploaded by the client is smaller than your product image

ImpressPages 4 : upload photo auto-rotate

I'm on IP 4.1.1.
I want to upload a photo (for photo or gallery widget for example).
I take a portrait photo (jpg) on my pc but when I upload it, it is in landscape format...
I try to use read_exif_data and imagerotate (like in this post : PHP read_exif_data and Adjust Orientation) but it doesn't work.
An idea? Thanks in advance and have a nice day :)
At first you are talking like an end user "upload photo ...". But then you say you are ysing read_exif_data function and other stuff which is a programming.
If we are talking about the end user interface. Most likely your photo is actually landscape, but has meta data about how the image has to be rotated before displaying it. In that case just rotate the image on your computer and reupload.

Image upload crop resize save to folder

I want from user to upload an image of any size for (jpg,png,gif) format. After uploading the image I want him to crop the image (client side) using jquery and save that cropped image (php) to application folder.
Please tell me the feasible solution to make this functionality working fine.
ImageMagick is used for croping images:
http://www.sitepoint.com/crop-and-resize-images-with-imagemagick/
For using ajax:
http://www.sanwebe.com/2012/05/ajax-image-upload-and-resize-with-jquery-and-php
Given that you already have the PHP code to crop, use one of this plugins to allow the user define how she wants to crop the image and provide the data you need:
Guillotine: Very lightweight plugin that allows to crop, zoom and rotate images with touch support and it's responsive (demo).
Jcrop: Allows free selection cropping (demo).
It is simple image crop using jquery and php using cropbox.js
Please watch the following video
Simple image crop

Resizing before Uploading in PHP SWF Uploader Overlay DEMO

How to add the facility "resize image before upload" in SWF Overlay Demo.
http://demo.swfupload.org/v250beta3/resizedemo/index.php
http://demo.swfupload.org/v220/overlaydemo/index.php
I want this resizing facility(1st link) in overlay demo(2nd). Could you please help?
is it possible to get "image resizing before upload" in the second link ?
They way I've done it is I let the user upload the image to a temporary location using this ajax flash uploader... http://valums.com/ajax-upload/
The flash uploads to a php script that creates 2 temporary version, the first one a resized version and the second the original. Then I return a json response with the path to the temporary files.
Then I load the resized version amd use this cropping http://deepliquid.com/content/Jcrop.html with a ratio constraint to get the portion of the picture to capture.
To complete the process the user submits the selected coordinates and the path to the temporary images to another scirpt which then takes the coordinates maps them to the original image and extract the portion of the image and resize it to the desired size using GD.

Categories