Ankit Jaiswal
Ankit Jaiswal

Reputation: 23427

Changing the color of a part of image using PHP and Javascript

I am working on an application where what I exactly need to do is, to open an image, select some part of it using javascript, selecting a color through a javascript color picker and then apply that color to the selected part of the image.

I am familiar with a few jquery plugins to select a part of the image and implementing a color picker (some javascript or jquery plugin) , however I am stucked in applying the color to the selected part of the image. I know this needs server side implementation,I am using php.

Please suggest.

Thanks in advance.

Upvotes: 2

Views: 998

Answers (2)

Klemen Slavič
Klemen Slavič

Reputation: 19841

Consider using something like Raphaël. You can do whatever you want on the client, then serialize the canvas data and post it back to the server or save it within the client.

Obviously, there are some limitations (IE being one of them).

Upvotes: 2

user368191
user368191

Reputation:

You will be only able to draw an object like line, circle, rectangle with fill colors and some transparency..

if that is like what you are looking for..

you can do that with php GD library, using php methods like drawcircle, with parameters for circle or rectangle coordinates, fill color, fill color's opacity (transparency).

Upvotes: 3

Related Questions