Dysan Posted November 12, 2007 Share Posted November 12, 2007 Hi! Using PHP 5, can an a section of an image be selected, and return the RGB values of 3 of most most average colours, contained in the selected area of the image? Quote Link to comment Share on other sites More sharing options...
Orio Posted November 12, 2007 Share Posted November 12, 2007 You can fetch the RGB values of each pixel in the area you want (using GD of course), and calculate the average... Orio. Quote Link to comment Share on other sites More sharing options...
Dysan Posted November 12, 2007 Author Share Posted November 12, 2007 How allow the user to select an area of an image, using his/her mouse? Quote Link to comment Share on other sites More sharing options...
Branden Wagner Posted November 12, 2007 Share Posted November 12, 2007 I would think you would do this using Javascript, i dont know how you would do that via php, with the exception of... making every pixel in the image an image map-> sending it to GD2 and then getting the RGB values for it. Whats the purpose? do you have one image? or a color pallete? that the user selects a color from.. to do what with? Quote Link to comment Share on other sites More sharing options...
Dysan Posted November 12, 2007 Author Share Posted November 12, 2007 Its just to return 3 RGB values, from the average colour, contained in the selected area? Quote Link to comment Share on other sites More sharing options...
Branden Wagner Posted November 12, 2007 Share Posted November 12, 2007 is the selected area, a picture? is it always the same picture? is the selected area a color pallete? you want to look into both of these imagemagick GD Library One of those will be able to do it. If you have code, I can help you write it, but i wont write it for you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.