Generate a bitmap in js