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

Enhancement: add support for WebP compression within TIFF output #3198

Closed
joesong168 opened this issue Apr 20, 2022 · 3 comments
Closed

Enhancement: add support for WebP compression within TIFF output #3198

joesong168 opened this issue Apr 20, 2022 · 3 comments

Comments

@joesong168
Copy link

Actually vips support webp in pyramid tiff in certain platform like ubuntu but not windows. Is it possible for sharp to support webp in all platform when vips didn't. The basis for this feature relies on libtiff, so I guess updating libtiff to latest version would supposedly solve the problem.

libvips/libvips#1839

Regards

@lovell
Copy link
Owner

lovell commented Apr 20, 2022

It's possible the prebuilt libvips binaries provided for Windows already supports this according to https://github.com/libvips/build-win64-mxe/blob/8f930b90e7a02b279ae2b8b9093ff7128a418726/build/overrides.mk#L228

The script to build the Linux and macOS binaries would need the addition of --with-webp-include-dir and --with-webp-lib-dir flags approximately here - https://github.com/lovell/sharp-libvips/blob/e44951ab0043efc525cc60eeab2efaf4e4dab35e/build/lin.sh#L328

We'd also need to modify the following to allow webp as a possible value:

if (is.string(options.compression) && is.inArray(options.compression, ['lzw', 'deflate', 'jpeg', 'ccittfax4', 'none'])) {

Happy to accept PRs for these, probably starting with the scripts that build libvips binaries, if you're able.

@lovell lovell changed the title Support webp in pyramid tiff Enhancement: add support for WebP compression within TIFF output Apr 20, 2022
@kleisauke
Copy link
Contributor

I can confirm that this already works on Windows, tested with:

vips copy zebra.jpg x.tif[compression=webp,pyramid]

Perhaps the packbits compression should also be allowed? The prebuilt binaries should already include support for this.

We could also add zstd and jp2k to that list for users who have built sharp with a globally installed libvips with support for those TIFF compression options (using libzstd and OpenJPEG).

@lovell
Copy link
Owner

lovell commented Sep 5, 2022

v0.31.0 now available with this improvement, thank you for the suggestion.

@lovell lovell closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants