-1

I am looking to create a Product customisation tool in PHP. This tool will allow the user to create his own Customization to a predefined Mobile cover. I already have a Mobile cover image and I am looking to allow a user to write his name under a background colour on the Mobile cover image. User can change the font size and style for his name.

I am not sure how to proceed ahead with it. I am looking to dynamically create image that is placed on the Mobile cover in such way that it looks its part.

I am looking for way on how to approach it and which php image handling libraries should I make use of .

Help would be greatly appreciated.

Mohit Dhiman

2

2 Answers 2

1

In my opinion you would be better using Ajax but with the image manipulation tool Imagick. However a downfall is this could potentially be very slow and also could use alot of CPU usage if your generating on the fly. Alother solution is you maybe able to find some flash product editors out there that all ready have this in built function, the only downside been the browser compatability issue with mobile devices.

I think the best way would be to have a template image and an ajax enabled upload function that inputs that image onto a canvas (maybe html5) and then use a dragable html5 or jquery canvas and track the x and y axis on the image:

here are some maybe useful links:

http://jqueryui.com/draggable/ - jquery dragable

http://www.w3schools.com/html/html5_draganddrop.asp - dragable canvas

Drawing Uploaded Image(with Ajax) to Canvas - drawing uploaded image to canvas

Imagick php - http://php.net/manual/en/class.imagick.php

Sign up to request clarification or add additional context in comments.

4 Comments

Just out of curiousity, where did that 72 dpi come from? Do you have a link? I've heard that before but can't find an official reference.
this is from previous usage but it you look at php.net/manual/en/function.imagejpeg.php you maybe able to change the DPI now. php.net/manual/en/function.imagejpeg.php
I don't think GD affects image resolution. As this Stack Overflow answer to an unrelated question points out, "DPI doesn't exist in digital. There are only pixels..." Certainly, one can set JPEG's quality factor, but that doesn't have anything to do resolution. Regardless, I wouldn't recommend JPEG for print anyway.
Yeah i think your right i will remove the bit about DPI however i would still recomend imagick as it has a lot more functionality then php's own GD.
0

You can create a draw.php file . this file will get some query strings like backgroundcolor, text etc. and draw an image with this datas.

Now when user change backgroundcolor, you will make an ajax call to draw.php?backgroundcolor=BLABLA&text=SOMETEXT... and you can display result on your page.

First learn have to draw images with php and than learn making ajax calls. After these, you can ask again.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.