1

Is there a way to check only if two UIimages are different. Right now I am using following method which works fine but it takes time. Is there any alternative? It should return false if there is any pixel of mismatched area.

if ([UIImagePNGRepresentation(lastImage)                       
   isEqualToData:UIImagePNGRepresentation(newImage)] )
  {
     return true;
  }
else
  {
     return false;
  }
Mario S
  • 11,715
  • 24
  • 39
  • 47
user1798933
  • 981
  • 1
  • 7
  • 7

1 Answers1

0

if you use TIFF there's no image conversion done. Takes very little time.

NSData *data = [image TIFFRepresentation];
NSData *data2 = [image2 TIFFRepresentation];

if ([data isEqualToData:data2]) {
    // Do Stuff
}