Round your doubles to the nearest integer and then use the BufferedImage API.