import ‘dart:io‘ as Io; import ‘package:image/image.dart‘; void main() { // Read a jpeg image from file. Image image = decodeImage(new Io.File(‘test.jpg‘).readAsBytesSync()); // Resize the image to a 120x? thumbnail (maintaining the aspect ratio). Image thumbnail = copyResize(image,120); // Save the thumbnail as a PNG. new Io.File(‘out/thumbnail-test.png‘) ..writeAsBytesSync(encodePng(thumbnail)); }