added color and transparency support to ImagePainter