Category: Code

Use Imagemagick to convert image to bmp for game development

Often in game development you need to convert an image to some format, with a mask colour like magenta. I get tired of opening photoshop to deal with a trivial change.

This command line code converts an image to bmp and adds a magenta background:

1
convert original.gif -background magenta -flatten processed.bmp

jQuery – Waiting for the document to load

Running javascript after DOM is loaded

1
2
3
4
5
$(document).ready(function() {

alert('loaded!');

});

or…

1
$(function() { alert('hello'); });