0

Firstly a short description of what I have

  1. Images of the same size and format are being generated inside my iOS app.
  2. Every time an image is generated, it should be uploaded into some web service.

What I want to do is basically to use as less internet traffic as its possible. So basically I would like to know your suggestions on how to do this ?

I option that I though is to send first image to server, then the diff of the second image with the first one. So basically I'm able to reserve some traffic with this method. So also would like to know if anybody has done this kind of stuff, how have you implemented it ? i.e. what third party libraries etc.

Thanks in advance.

Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
deimus
  • 9,565
  • 12
  • 63
  • 107

2 Answers2

2

Why don't simply use the 'hash' method into UIImage class (iOS8+)?

@implementation UIImage (HashComparision)

- (BOOL) isEqualThanImage:(UIImage*)image
{
    return [self hash] == [image hash];
}
@end
ricky.tribbia
  • 124
  • 10
  • 1
    hah, quite simple +1 ! but the question is dated back to 2012. Beside comparision I had to construct also a "diff" image, so I went with CoreGraphics solutions ;) – deimus Mar 16 '15 at 09:20
1

I think you can use OpenCV to compare images and much more.

Also you can refer to a very good links on StackOverflow which is similar to your problem:

Compare two UIImages

Comparing UIImage

Let me know if you need more help.

Hope this helps.

Community
  • 1
  • 1
Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
  • @deimus: Did you refer to my answer? Did it help you? – Parth Bhatt Apr 07 '12 at 17:33
  • Hi Parth, actually yet I'm looking for. Can you please suggest a method using which I'll run less traffic when uploading new images. I mean if a get the difference of the images how may I submit thoes differences into webservice. To construct a new photo based on diff pixels or ? – deimus Apr 07 '12 at 19:12
  • Hello Parth, basically I've decided what I mean by saying image difference, I would like to get the difference minimum rectangle of two images that cover two image difference. Can you please point me to somewhere inside OpenCV ? – deimus Apr 11 '12 at 20:31
  • @deimus: I think we are just here to give ideas and directions. Now it is up to you how you work it out. If you face some specific problems then please let me know. – Parth Bhatt Apr 12 '12 at 04:30