mgSeek is a collection of free open source projects for searching a collection of images using visual similarity. The image you are looking for can be expressed either as a rough painted sketch or as another image you supply.
PerceptualDiff is an image comparison utility that makes use of a computational model of the human visual system to compare two images.
This software is released under the GNU General Public License.