Archive for December 8th, 2009

Unsticking Stuck LCD Pixels: A Script

Tuesday, December 8th, 2009

As I just recently sug­gested I might do, I have made a script for auto­mat­i­cally gen­er­at­ing color cycling ani­ma­tions of arbi­trary sizes and speeds.

The script can be used at: http://blog.gwax.com/files/rgbanim.php

The script accepts the para­me­ters height, width, and delay, so it can also be used in more inter­est­ing ways. Feel free to play around (if you crash it, let me know).

Ex.: http://blog.gwax.com/files/rgbanim.php?width=100&height=100&delay=7

Or, bet­ter still:

- Width - Height - Delay

For the curi­ous amongst you, the rel­a­tively sim­ple code follows:

< ?php
if(isset($_GET['delay']) && is_numeric($_GET['delay']))
	$delay = max((int)$_GET['delay'], 1);
else
	$delay = 10;
 
if(isset($_GET['width']) && is_numeric($_GET['width']))
	$width = max(min((int)$_GET['width'], 1920), 1);
else
	$width = 320;
 
if(isset($_GET['height']) && is_numeric($_GET['height']))
	$height = max(min((int)$_GET['height'], 1080), 1);
else
	$height = 240;
 
$out = new Imagick();
$out->newImage($width, $height, '#FF0000', 'gif');
$out->setImageDelay($delay);
$out->newImage($width, $height, '#00FF00', 'gif');
$out->setImageDelay($delay);
$out->newImage($width, $height, '#0000FF', 'gif');
$out->setImageDelay($delay);
 
header('Content-type: image/gif');
echo $out->getImagesBlob();
?>