Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Image Processiong using Java

 
Amol Pingate
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Frirnds,

Is it possible to identify that two image files like .JPEG or .BMP are equal by checking them pixel by pixel.


 
Rob Spoor
Sheriff
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out java.awt.image.BufferedImage and javax.imageio.ImageIO.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt very much that they would ever be equal since JPG is inherently lossy while BMP is not.

Bill
 
Rob Spoor
Sheriff
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But once loaded in memory, you can still compare the two. The results may not be what you expect, but you can still compare pixels (as ARGB values).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic