
By Shaun Mills
Converts media uploads to webp or avif
released February 5, 2026
npm install strapi-plugin-img-convertA Strapi plugin that enhances the built-in upload functionality by automatically converting uploaded images into formats like WebP and AVIF.
You can now pass sharp options for each image format. Check here for available options - https://sharp.pixelplumbing.com/api-output/
The optimizeSettings are also applied to the generation of responsive images.
Be warned that, if you have booth “optimize images” and “generate responsive images” active in the media library settings the “optimized image“ and not the original will be used to generate the responsive images.
NOTE: Strapi 4.x.x is not supported!
npm install strapi-plugin-img-convertor
yarn add strapi-plugin-img-convertconfig/plugins.js file:module.exports = {
upload: {
config: {
breakpoints: {
xlarge: { breakpoint: 1566, formats: ['webp', 'jpeg', 'png'] },
large: { breakpoint: 1280, formats: ['webp', 'jpeg', 'png'] },
medium: { breakpoint: 768, formats: ['webp', 'jpeg', 'png'] },
small: { breakpoint: 640, formats: ['webp', 'jpeg', 'png'] },
},
optimizeSettings: {
jpeg: { quality: 100 },
png: { compressionLevel: 9, effort: 6 },
webp: { quality: 100, lossless: true, nearLossless: true, effort: 6, smartSubsample: true },
avif: { quality: 50 },
},
},
},
};export default () => ({
upload: {
config: {
breakpoints: {
xlarge: { breakpoint: 1566, formats: ['webp', 'jpeg', 'png'] },
large: { breakpoint: 1280, formats: ['webp', 'jpeg', 'png'] },
medium: { breakpoint: 768, formats: ['webp', 'jpeg', 'png'] },
small: { breakpoint: 640, formats: ['webp', 'jpeg', 'png'] },
},
optimizeSettings: {
jpeg: { quality: 100 },
png: { compressionLevel: 9, effort: 6 },
webp: { quality: 100, lossless: true, nearLossless: true, effort: 6, smartSubsample: true },
avif: { quality: 50 },
},
},
},
});Note: Legacy configuration formats are still supported for backward compatibility.
For issues and feature requests, please create an issue on our GitHub repository.
MIT
Share your work with the community and get it listed in the Strapi ecosystem for everyone to discover and use.
Submit
