0

Is there an algorithm which can take advantage of a previous image in order to compress the next image with a level of compression / quality than otherwise?

I have an app which takes a photo of the sky ever few minutes and then uploads that to a single server. The camera is immovable.

It occurs to me that if I could references (previous image) then I should be able to compress losslessly at a higher rate.

So, I expect that when my local app starts it would upload the full image. The next time it takes an image it would feed (previous_image, new_image) to the compression algorithm, and I'd basically get the diff between the two. The algorithm should be intelligent about subtle color changes and movement (e.g., a cloud). Now local_app and server both have a copy of new_image (local_app has the original and server has the re-constructed) and in the next cycle local_app would feed (new_image, newer_image) to the algorithm.

I assume that this is much how video compression work, but short of recreating a two-frame video and then using a standard video compression algorithm, I haven't found an approach for this.

Something already implemented in python would be ideal. :)

James S
  • 101
  • 1
    yes, there are such algorithms. They are called video codec, as you correctly inferred; and you wouldn't compress two frames alone; you'd constantly stream the new data as soon as your video codec got enough input to calculate new output. many video encoders can be configured such that they do not need "future" frames, so that this works, and you can basically output frame-wise. – Marcus Müller Jan 26 '20 at 18:55
  • So if I wanted to send one image very few minutes, I'd find an appropriate video codec and basically keep it open, but stream just one new frame to it every 3 minutes, get the streamed output, send it, then do the reverse on the other end? – James S Jan 26 '20 at 20:31
  • yep, that's what I'd recommend :) – Marcus Müller Jan 26 '20 at 20:39
  • I just remembered stumbling across this – might help you, but I haven't tested whether the default x264 codec setting just flushes out after each frame – Marcus Müller Jan 26 '20 at 20:58

0 Answers0