Hi ,
libaries i mentioned above are not for comparing images but for loading, saving and displaying images in different format.
But when you load an image it means that you can access pixels of image individualy. then only the think you have to do is compare individual pixels seperatly. but if you have similiar image which are snapshoted in different lighting condition you can not achive proper compare operation. instead there are lots of
transform to compare images to solve problems like this.
this link is a project using content based image retrival and also has documents and source code
check out , what you need is in this link
**broken link removed**