added method to convert bufferedimage to rgb colorspace