About me

Vladimir Nabokov

Books
Programming
Biochemistry
Aim | Communicate

Search
 


 

 

     
 
 

     
Creepy eyes interfade demo  - simple, but surprisingly effective. Click to download
 
 
     

Creepy eyes interfade demo

Another product of my post Hi-Res programming days was the development of this palette fading demo. The idea originally came from palette fades as executed in (numerous) computer games, giving the effect of a gentle fade from one scene to another. Although it's easy to accomlish a fade to black/white, fading directly from one image to another requires more careful consideration, especially with only an 8 bit palette at your disposal. Effectively, each image was carefully converted to a 4-bit (16 colour) image in paint shop before hand, with minimal disruption of the image (apart from the inevitable pixelation). This could then be imported into canvas, and converted to an .img file, with the seperate storage of the palette for each image. The basic idea is this: if one image containing 16 colours must fade into a similar image, each pixel of one colour can fade with 16 potential combination. The total number of combination, ie. different types of pixel, must therefore be the product of this, 256. This allows the 16 colour image to be drawn in 256 colour mode, with each of the 16 colours repeated 16 times, representing the 16 different destination they could eventually arrive at. When the fade has to be implemented, all that needs to be done is the gentle transition of each of the 256 combinations from its starting to its terminal colour (RGB): the practical effect being a fade from one image to another, even though no actual pixels are plotted on the screen. The pixels are assigned their destination colour based upon the second image, which is loaded into the memory, and drawn accordingly by interconversion on a look-up table. The result is fast, smooth (much more than a directly drawing procedure), and produces a creepily insidious effect. I chose two images of eyes, randomly acquired from the internet, since I thought this would give the most unsettling effect. The cold blue ones are Hannible Lectur's (I believe), and the fetching dark ones are unidentified. Some interesting coding in this little demo: with slight effort could be exercised into an independent procedure and incorporated into a larger program. Available for download with full source.

Download 'eyes' demo (72 kb, zipped) | Back to Graphical trinkets

 
 
Letters from Terra | Updated 15th December 2004 | By Jonathan Ayling