I don't think image manipulation is in the scope of this plugin. You can use a package like image to resize your images.
final asset = await rootBundle.load("assets/fox.jpg");
final inputImage = decodeImage(asset.buffer.asUint8List());
final scaledImage = copyResize(inputImage!, width: 200);
final avifBytes = await encodeAvif(img.encodeBmp(scaledImage));
If the source image is also avif:
final asset = await rootBundle.load("assets/fox.avif");
final codec = SingleFrameAvifCodec(bytes: asset.buffer.asUint8List());
await codec.ready();
final frame = await codec.getNextFrame();
final uiImage = await frame.image.toByteData(format: ImageByteFormat.png);
final inputImage = decodeImage(uiImage!.buffer.asUint8List());
final scaledImage = copyResize(inputImage!, width: 100);
final avifBytes = await encodeAvif(img.encodeBmp(scaledImage));
If it is an animated avif you would have to use MultiFrameAvifCodec and get each frame by calling codec.getNextFrame() then add them to the inputImage you first created.
I don't think image manipulation is in the scope of this plugin. You can use a package like image to resize your images.
If the source image is also avif:
If it is an animated avif you would have to use MultiFrameAvifCodec and get each frame by calling codec.getNextFrame() then add them to the inputImage you first created.