Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mode without preserving structure of the original JPEG file #80

Open
vrubleg opened this issue May 6, 2020 · 3 comments
Open

Mode without preserving structure of the original JPEG file #80

vrubleg opened this issue May 6, 2020 · 3 comments

Comments

@vrubleg
Copy link

vrubleg commented May 6, 2020

As far as I can see, JXL created by Brunsli can be extracted exactly to the same (byte-by-byte) JPEG file. Could compression ratio be a bit better if we recompress just JPEG image data losslessly, without storing additional information how original JPEG was encoded?

@eustas
Copy link
Collaborator

eustas commented May 6, 2020

Yes, that is also possible: just carefully retouch JPEGData object after ReadJpeg, but before BrunsliEncodeJpeg. Later we will provide utility function that will do exactly that.

@vrubleg
Copy link
Author

vrubleg commented May 6, 2020

If this additional information is removed, will it be possible to convert this image data back to JPEG without losing quality? It is clear that the JPEG data will be encoded in some different way in this case, and the JPEG file won't be equal to the original JPEG, but it is OK until the image data is still the same.

@eustas
Copy link
Collaborator

eustas commented Jul 14, 2020

There are 2 parts (modulo ICC profiles) that contain the complete information about image (pixels) - DCT coefficients and quantisation table. Everything else (Huffman tables, scan scheme, reset points) are details of encoding. So if we drop / replace those and serialise JPEG we will get different file, but same image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants