0

Possible Duplicate:
RGB to HSV in PHP

Please help,I googled many script but all not work .. Can somebody tell me how to write a function to do the conversion?

Community
  • 1
  • 1
  • 1
    Don't look for a PHP specific solution, look for the general algorithm for doing it and use that as a basis for a PHP implementation. – GordonM Oct 25 '12 at 11:06
  • i am working on image processing.why you want to convert rgb to hsv.i facing same difficulty of varying color range. – Ankur Saxena Nov 08 '12 at 12:57
  • @AnkurSaxena I need to learn to convert rgb to hsv, because the V in hsv is the brightness. If you are looking to put a watermark on an image (like I need to), you need to know if the image is averaged light or dark. No sense putting a black watermark on an image of the night sky. Same thing goes for putting a white image in a snowy scenery. This is done by taking the area to be watermarked, and shrinking it to 1x1 image. Then get the rgb value of the pixel and calculate the value (brightness). – Deanie Sep 28 '17 at 02:05

0 Answers0