Analyzing Images

These functions are part of PHP's core and do not require loading an extension.

string gamma_correct_tag(string color, double original, double new)

The gamma_correct_tag function adjusts an HTML color from one gamma to another. Video display hardware is given a gamma rating that describes relatively how bright images appear. Identical images appear lighter on Macintosh hardware than on the typical Wintel clone. The W3C has a nice discussion about color spaces that includes information about gamma values: <http://www.w3.org/Graphics/Color/sRGB.html>.

<?
  //go from Windows gamma to Macintosh gamma
  $color = gamma_correct_tag("#CC0000", 2.2, 1.571);
  
  print("FONT COLOR=\"$color\">");
  print("Sample Text");
  print("/FONT>");
?>

array ...

Get Core PHP Programming: Using PHP to Build Dynamic Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.