I recommend posting an SSCCE that reproduces the problem - the code posted is not clear as to what 'bi' is (BufferedImage?) and how it was constrcted (if a BufferedImage - does it have alpha, how are...