Live data from Hacker News

Lepton image compression: saving 22% losslessly from images at 15MB/s

blogs.dropbox.com

21–30 of 196 posts

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#21
This is very impressive for archiving images.

For a quick test, I run it over ~1.3GB JPEG pictures I had locally, the finally result is 810M, that's 66% of the original size, very impressive considering it's lossless. It only deals with jpg file though, no png, no iso, no zip, no any formats other than JPG.

If someone can do this over video files that will be PiedPiper comes into real life.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#22
post #2

Does Dropbox do block or file-level deduping?

Block, it deduplicates based on 4MB blocks. Source: https://news.ycombinator.com/item?id=2478595

I wonder if they use a rolling checksum too, to avoid duplicating a complete file if only a view bytes shifted (for example adding a line of text in the beginning of a file)

The backup tool bup (https://github.com/bup/bup) does this.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#23

Great work. Ensuring bit-by-bit identical output and compressing an extra 22% is amazing. > For those familiar with Season 1 of Silicon Valley, this is essentially a “middle-out” algorithm. I really wish that every single compression-related blog post would stop referencing Silicon Valley.

They will once Silicon Valley takes them to task for it. Just like season 1 pretty much wiped "making the changes world a better place" from the lingo of SV companies.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#24

I really admire Dropox for open sourcing this, it shows their commitment. Saving almost a quarter of space for most images stored is something that truly gives a competitive edge. (I say most because people probably primarily have JPEG images). Especially considering how many images are probably stored on services like Dropbox. And they just gave it away to their competitors.

Then why do you admire them? Would you also admire them if you were their investor? Dropbox management is obligated by law to act in the best interests of their shareholders, i.e. to make them as much profit as possible.

It's more likely that they have released it because of some profit-seeking interest. They are not charity.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#25
post #21

This is very impressive for archiving images. For a quick test, I run it over ~1.3GB JPEG pictures I had locally, the finally result is 810M, that's 66% of the original size, very impressive considering it's lossless. It only deals with jpg file though, no png, no iso, no zip, no any formats other than JPG. If someone can do this over video files that will be PiedPiper comes into real life.

Over 3D video files...

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#26
post #21

This is very impressive for archiving images. For a quick test, I run it over ~1.3GB JPEG pictures I had locally, the finally result is 810M, that's 66% of the original size, very impressive considering it's lossless. It only deals with jpg file though, no png, no iso, no zip, no any formats other than JPG. If someone can do this over video files that will be PiedPiper comes into real life.

Thanks for testing this! For archival purposes, be sure to check the exit code of the lepton binary after compressing each JPEG: the default parameters only support a subset of JPEGs (you need to pass -allowprogressive and -memory=2048M -threadmemory=256M to support a wider variety of large or progressive JPEG files). Lepton will not write images that it is unable to compress using the settings provided. In those cases be sure to keep the original JPEG.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#28

Could someone explain to me how compression algorithms work? Shouldn't they not work very consistently, by pigeonhole principle?

It's very easy to make a JPEG file that will not compress at all. Luckily it might look like snow from a television set rather than a typical image produced by a camera.

We live in a world where it is common for blue sky to occupy a portion of the frame and green grass to occupy another portion of the frame. Since images captured of our world exhibit repetition and patterns, there are opportunities for lossless compression that focuses on serializing deviations from the patterns.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#29

I really admire Dropox for open sourcing this, it shows their commitment. Saving almost a quarter of space for most images stored is something that truly gives a competitive edge. (I say most because people probably primarily have JPEG images). Especially considering how many images are probably stored on services like Dropbox. And they just gave it away to their competitors.

Then why do you admire them? Would you also admire them if you were their investor? Dropbox management is obligated by law to act in the best interests of their shareholders, i.e. to make them as much profit as possible. It's more likely that they have released it because of some profit-seeking interest. They are not charity.

I admire them because they certainly considered the pros and cons of doing so, and decided that they feel secure enough in their market position and prefer to give this back to the open source community

Pretty much every modern company safes tremendous amounts of money from open source (Linux and upwards in the stack), and so the OSS community should rightly be considered a STAKEholder.

The share vs stakeholder obsession in the space of large companies and corporations represents a lot that's wrong with our current markets.

--

Also, the only upside to open sourcing this is getting other involved in development. I just tested on 10k images, and the promise both on compression rate and bit parity after decompression holds true.

Seems to be a pretty stable product, so the that motivation is probably only miniscule.

Re: Lepton image compression: saving 22% losslessly from images at 15MB/s

#30
post #21

This is very impressive for archiving images. For a quick test, I run it over ~1.3GB JPEG pictures I had locally, the finally result is 810M, that's 66% of the original size, very impressive considering it's lossless. It only deals with jpg file though, no png, no iso, no zip, no any formats other than JPG. If someone can do this over video files that will be PiedPiper comes into real life.

The reason this can be done with JPEGs is the compression hasn't been updated. There are folks that have used h264 for compressing images and webp uses vp8 compression, both with much better results than JPEG.

Lepton is cool because it helps make existing technology a whole lot better, but what we actually need is a better image format.

You wouldn't see the same leap for videos because people have been working hard to make those great for a while while JPEG has been left to rot.

Post reply on HN