Navigation Bar Home Gallery Blog Articles Tools and Reference About Links

Image Gamma Redirector in PHP

This PHP script will choose from two different gamma-corrected images based on whether the page is being viewed from a Windows/*nix machine or a Mac. Macs generally have a target gamma of 1.8 while Windows and non-Apple *nix has a target of 2.2 or 2.4 (which usually nets out to about 2.2 in average lighting). The result is that images made on Macs look too dark on everything else and images made on everything else look too light on Macs. This script solves the problem by detecting which platform the browser is running on and automatically redirects the request to an appropriate gamma-corrected copy that you've prepared ahead of time.

Yes, you do have to manually prepare two versions of each image, but if you're a visual artist of some sort and have an online gallery of your work, it may be worth the extra effort to allow people to see it [relatively] accurately.


How to use


Copyright © 2006 Nicolai Grossman

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.


Current version:

Version history

v1.0, 15 Jan 2006
Initial release