Is there any inbuilt java API or class library for accessing pixels in a given image? What I am planning to do is search one image inside another image. For example : img1 is 24x24px , img2 is 1024x768px assume that a symbol, similar to img1 may exists in img2 . Now I want to get X and Y coordinates of the symbol which is similar to the img1.
Yes, there is, if you have your image as a BufferedImage
then use the getRGB(int x, int y)
method to get the value of the pixel at the position (x, y).
See the API documentation of java.awt.image.BufferedImage
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With