#native_company# #native_desc#

HUE shift

By Osman Darcan
on January 18, 2004

Version: 1

Type: Sample Code (HOWTO)

Category: Graphics

License: GNU General Public License

Description: this is a little script for shifting HUE in an image (remember hue, saturation, brightness?) in other words it means shifting the colors of a picture, for example red becomes green, gren becomes blue, blue becomes red.
Do whatever you want with it, but remember who’s tha man…

/* made by ozzythaman, Osman DARCAN in 2003
   this is a script for shifting HUE data in an image,

   no explanation will be provided, figure it out yourself.
   play with it see what it does, input file is b2.jpg by default.
   change it to suit your own needs.

   if you still need any explanation you dont deserve to use this.

   to try out: put <img src='thisfile.php'> in a html file and change b2.png to an
   other image file (if not png: change the function to imagecreatefromjpg or whatever)
   this php file will act as an image itself.

function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);


if ($onetwoorthree+1>2)
//echo " ".$ar[0]." ".$ar[1]." ".$ar[2];

$im = imagecreatefrompng("b2.png") or die ("Cannot Initialize new GD image stream");

header ("Content-type: image/jpeg");
for ($x=0;$x<$width;$x++){
	for ($y=0;$y<$height;$y++){
		$rgb = ImageColorAt($im, $x, $y);
		$r = ($rgb >> 16) & 0xFF;
		$g = ($rgb >> 8) & 0xFF;
		$b = $rgb & 0xFF;



		$color = imagecolorallocate($im2, $r, $g, $b);