What are you trying to compare between the two images? You say 'search', are you trying to search an image for something? Color, feature, sub-image? What does your algorithm currently compare?