native_image_compress 0.2.1
native_image_compress: ^0.2.1 copied to clipboard
Compress images to JPEG, PNG, WebP, HEIC, or AVIF using the platform's native encoders.
native_image_compress #
Compress images to JPEG, PNG, WebP, HEIC, or AVIF using the platform's native encoders.
Platform support #
| Android | |
|---|---|
| Support | SDK 28+ |
| JPEG | ✅ |
| PNG | ✅ |
| WebP | ✅ |
| HEIC | ✅ |
| AVIF | ✅ |
Android #
This plugin requires minSdk 28. If your app' minSdkVersion is lower, raise it in android/app/build.gradle.kts:
android {
defaultConfig {
minSdk = maxOf(flutter.minSdkVersion, 28)
}
}
Usage #
import 'package:native_image_compress/image_compress.dart';
final jpeg = await compressToJpeg(
originalBytes,
quality: 80,
);