For this you can use copyCrop function. Here is an example
import 'dart:ui' as ui;
import 'package:image/image.dart' as img;
final double left = ...;
final double top = ...;
final double width = ...;
final double height = ...;
final bytes = File(image.path).readAsBytesSync();
final rawImage = img.decodeImage(bytes);
final pictureRecorder = ui.PictureRecorder();
final canvas = Canvas(pictureRecorder);
final paint = Paint();
canvas.drawImage(imgCodec, Offset.zero, paint);
final croppedImage = img.copyCrop(
rawImage,
left.toInt(),
top.toInt(),
width.toInt(),
height.toInt(),
);
final croppedBytes = img.encodePng(croppedImage);
final croppedImageFile = await saveImageToDisk(croppedBytes);
model.img = croppedImageFile.path;
In the above code, replace ... with your actual values for the cropping rectangle.