8000 Support HEIC image encoding with libkvazaar by cmb69 · Pull Request #906 · libgd/libgd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support HEIC image encoding with libkvazaar #906

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmb69
Copy link
Member
@cmb69 cmb69 commented Dec 22, 2024

libheif currently supports x265 and kvazaar for encoding HEIC images; while the former is recommended, the latter has a more liberal license, and as such is an interesting alternative. However, kvazaar apparently does not yet support changing the chroma subsampling, and as such, writing HEIC images fails. We apply basically the same fix as for libheif < 1.9.0, where we just ignore the given chroma subsampling, and use whatever the encoder deems suitable (likely 420).

[1] https://github.com/strukturag/libheif?tab=readme-ov-file#compiling


Note that this fixes tests/heif/bug788 for me, and let's tests/heif/heif_im2im proceed (it now only fails due to pixel differences; likely that would happen with older libheif, too).

Also note that comparing the plugin name might be a bit brittle, but comparing the plugin ID might be too, and seems to require more ado, so maybe we're good comparing the name.

Since we support HEIF encoding not only with HEVC, but also with AV1, it seems to prudent to check whether the AV1 encoders supported by libheif (currently AOM, rav1e, and svt-av1), work as expected, or show similar limitations as kvazaar (chroma subsampling is supported by all three, but there may be other limitations).

cc @YakoYakoYokuYoku

libheif currently supports x265 and kvazaar for encoding HEIC images;
while the former is recommended, the latter has a more liberal license,
and as such is an interesting alternative.  However, kvazaar apparently
does not yet support changing the chroma subsampling, and as such,
writing HEIC images fails.  We apply basically the same fix as for
libheif < 1.9.0, where we just ignore the given chroma subsampling, and
use whatever the encoder deems suitable (likely 420).

[1] <https://github.com/strukturag/libheif?tab=readme-ov-file#compiling>
@cmb69
Copy link
Member Author
cmb69 commented Dec 22, 2024

The Ubuntu and macOS CI failures are unrelated; the Windows CI failure might be related, though. Need to check.

@cmb69 cmb69 marked this pull request as draft December 22, 2024 12:39
@cmb69
Copy link
Member Author
cmb69 commented Dec 22, 2024

I can reproduce locally with https://github.com/libgd/libgd-windows-vcpkg-prebuild; looks like a bad build (see strukturag/libheif#357 (comment)). No way to work around this. I think we need to update the dependencies for Windows anyway.

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

Successfully merging this pull request may close these issues.

1 participant
0