Douwe Osinga's Blog: Visited Countries

Sunday, December 14, 2003

Visited Countries, my project for this week,  is a little Web App that allows you to enter that countries you've been to and it generates a map of the world with those countries in red, the others in green.

I did the project to demonstrate how to manipulate the appearance of a gif image by just changing the palette on the fly from a web page. I started out with a gif image in which every country has a different color, RGB(160, 245 - Index, 10 + Index), where Index is a number in my country table. Now, when I need a map, the script reads the map and copies everything except for the palette entries (bytes 13 - 13 + 255*3), which it checks for Index values in the selected list, replacing them by red, or not, replacing them by green.

You can copy the image and put it on your homepage if you think that's cool.