CSS Image Sprite Maker in Python

css sprites

If you have a number of small images on your website, for example those used for icons or buttons, it is more efficient to combine them into a single image which is usually smaller in size and requires only one HTTP request to download. You can then use CSS to specify an offset to the exact position of the individual image in the combined image.

Creating the combined image and corresponding CSS can be done by hand but this is time-consuming, boring and error-prone so I have written a simple Python module to do the job for you.

Continue reading

An Introduction to Web Hosting with GitHub Pages

In your travels around The Internet you may have encountered sites with URLs ending in .github.io. These use GitHub's own minimalist but very useful hosting service called GitHub Pages which is available free to anyone with a Github account.

In this article I'll show how easy it is to get up and running with the service, as well as exploring what you can and cannot do.

Continue reading

Generating and Using Base 64 Images with JIMP

One of the JIMP library's many features is the ability to create a Base 64 string from an image. This has various uses (some nefarious...) but in this post I will demonstrate embedding a Base 64 encoded graphic as an image source in an HTML document. This is useful for small images such as logos or button graphics, and while I am using HTML the Base 64 string can also be used in CSS.

Continue reading