dropbox / lepton

Lepton is a tool and file format for losslessly compressing JPEGs by an average of 22%.
https://blogs.dropbox.com/tech/2016/07/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs/
Apache License 2.0
5.01k stars 355 forks source link

Can I read *.lep files directly into pixels array? #74

Open xpol opened 7 years ago

xpol commented 7 years ago

Can I read *.lep files directly into pixels array without restore them back to jpg files? Any examples?

danielrh commented 7 years ago

Excellent question. During decode, we do keep 2 rows of a framebuffer in memory and fill them with data. And we take each channel into pixel space to predict the DC. It wouldn't be hard to persist the pixel-space values beyond the two rows into a whole framebuffer. Then, the end portion with the JPEG recode could be lopped off without too much trouble. This wouldn't be a huge change, actually--but it would require some code