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

Consider use of libjpeg-turbo extension framework for control over encoder settings #45

Open
lovell opened this issue Oct 27, 2024 · 0 comments

Comments

@lovell
Copy link
Contributor

lovell commented Oct 27, 2024

Hello, thanks for creating jpegli and many of the JPEG-XL features it descends from. This suggestion was originally discussed at lovell/sharp#4018 (comment) and I'm opening an issue here on the recommendation of lovell/sharp#4018 (comment)


The libjpeg-turbo approved (and mozjpeg implemented) method of configuring a JPEG encoder whilst maintaining ABI compatibility is to use its extension framework.

This is provided via a series of functions such as jpeg_c_bool_param_supported and jpeg_c_set_bool_param (with similar functions for integer, float etc. types). These were added to mozjpeg via mozilla/mozjpeg@db2986c

As well as fine-grained control over specific encoder features, there is also a simpler JINT_COMPRESS_PROFILE setting that provides a single switch between "use all features" JCP_MAX_COMPRESSION and "do nothing, behave like libjpeg" JCP_FASTEST. This was added to mozjpeg via mozilla/mozjpeg@3e2cf69

For reference, the complete set of features mozjpeg exposes via the extension framework can be seen at https://github.com/mozilla/mozjpeg/blob/6c9f0897afa1c2738d7222a0a9ab49e8b536a267/jpeglib.h#L277-L314

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

1 participant