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

support vips avif speed #463

Merged
merged 2 commits into from
Aug 9, 2024
Merged

support vips avif speed #463

merged 2 commits into from
Aug 9, 2024

Conversation

liudongmiao
Copy link
Contributor

This PR try to add avif speed for imagor.

It's said imagor doesn't support avif speed, while similar image cdns like thumbor and imgproxy do support.
In a test with wrk, imagor is faster than thumbor and imgproxy, and with a smallest Stdev.

Please note, libvips has changed to parameter from speed to effort in 2021, however, speed still works.
ref 1: https://www.libvips.org/API/current/VipsForeignSave.html#vips-heifsave-buffer
ref 2: https://github.com/libvips/libvips/blob/master/libvips/foreign/heifsave.c
(libvips would convert effort to speed again for heif's api. :-)

BTW, heif support different speed for different codec:
aom 0-9, https://github.com/strukturag/libheif/blob/master/libheif/plugins/encoder_aom.cc
rav1e 0-10, https://github.com/strukturag/libheif/blob/master/libheif/plugins/encoder_rav1e.cc
svt 0-13, https://github.com/strukturag/libheif/blob/master/libheif/plugins/encoder_svt.cc

@cshum
Copy link
Owner

cshum commented Aug 9, 2024

Thanks for the PR! Would be great if you can test a test assertion for WithAvifSpeed at
https://github.com/cshum/imagor/blob/master/vips/option_test.go

@cshum cshum changed the base branch from master to develop August 9, 2024 14:47
@cshum cshum merged commit 82e9a05 into cshum:develop Aug 9, 2024
4 checks passed
@liudongmiao
Copy link
Contributor Author

Thanks for merge.

@cshum
Copy link
Owner

cshum commented Aug 10, 2024

Before the next version release, this is currently available under the Docker build of develop branch:

https://github.com/cshum/imagor/pkgs/container/imagor/255863182?tag=develop

ghcr.io/cshum/imagor@sha256:cd5469eaf7541eee310e9dc9ca90490a931781673cbc8875ddea3a1fcc0e9081

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.

None yet

2 participants