简体   繁体   中英

Is there an algorithm to compress multiple images that are not much different apart?

I have a set of 100+ images that only differ a few pixels. They also don't have many different colors. Is there a way to compress them together by taking advantage of that?

There's an algorithm: calculate the difference of each image to some reference image. Is there a ready made application? Probably not. One approach could be to combine the images to a very big image (by interleaving or placing them next to each other) and using png.

If this is for archiving purpose and you don't need a random access to them, you can concatenate them to zip / tar (with zero compression) and compress the whole thing. .bz2 algorithm (Burrows-Wheeler Transform) is able to search for similarities over much larger window than deflate of png. It's an order of ten megabytes vs. 10 kilobytes. If the images are large enough, the window size will limit the compression in both algorithms -- that would have to be combat by interleaving or delta compressing between each image.

The delta compression is utilized regularly in some video compressing applications and eg screen capture and virtual desktop applications where lossless compression is required.

String them together as a movie and use video compression. That is exactly what video compression does.

Nothing ready-made. If you want lossless compression, you could store just a reference image and the delta images (difference of images at the pixel leve), each one encoded with PNG. But you must write yourself the delta transformation.

You could also take advantage of the delta compression mode of the MNG format, an extension to PNG for animation (each of your image would be an animation frame). But the format is not widely supported.

You could also take the same approach (one image = one video frame) and use any standard video format (MPEG) but this would be lossy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM