If you want to use the rgbToHsv method from a file, you get blue and red inverted. One way to fix this is to type: im = ImageUtil.convertImage(im,BufferedImage.TYPE_INT_BGR); Team Poutrelle