Base64-Encoding Images for CSS in TextMate ========================================== By George Mandis https://george.mand.is/2011/06/base64-encoding-images-for-css-in-textmate Tuesday, June 7th 2011 Base64-encoding your images reduces the number of HTTP requests your page makes by effectively embedding the image in your HTML or CSS. It is particularly useful for logos, backgrounds and UI elements where you want to avoid the progressive loading effect that happens when the user first visits the page. There are plenty of scripts out there that show you how to base64 encode a file, but I thought it would be handier to make a TextMate command. Now when I'm editing my CSS I can reference the actual image files as I normally might, which is easier to understand at a glance, and base64-encode them as I need to with this command. To get started, open up the Bundle Editor and create a new command that looks like this: #!/usr/bin/env php