java color image processing
I am trying to get the different amount of colors inside an 开发者_StackOverflowimage in java, but I don't know if there is a library for this propose of not. the project is about finding out the different colors from one image, and then print out the name of the colors. any idea??? please help me if you have any answer.
You can turn an image into a BufferedImage and call getRGB(int x, int y) to get the rgb for each pixel. Then you can use one of the many color websites such as this one or this one to map the rgb to a color name. Just find the named color which is the closest in distance to each rgb in the image.
Java has the Java Advanced Imaging (JAI) library which is built to allow stuff like this.
精彩评论