title: How to resize and filter the image in flutter?
body: <p>In Flutter, how can I perform the following 3 steps:</p>
  
  <ol>
  <li>Read an image from disk,</li>
  <li>Resize it.</li>
  <li>Change brightness, etc.</li>
  <li>Use it as a file.</li>
  </ol>
  
  <p>I've tried it with <a href="https://pub.flutter-io.cn/packages/image" rel="nofollow noreferrer">this</a> but it still give me the large file.</p>
  
  <pre><code> IM.Image fileImage = IM.decodeImage(file.readAsBytesSync());
  
      var newWidth = (fileImage.width / 100 * 10).toInt();
      var newHeight = (fileImage.height / 100 * 10).toInt();
      IM.Image resizeImage = IM.copyResize(fileImage, height: newHeight, width: newWidth);
  
      IM.Image modImage = IM.adjustColor(resizeImage,
          brightness: 50, contrast: 50, saturation: 0.0, amount: 1);
  
      final tempDir = await getTemporaryDirectory();
      File compressedImage = new File('${tempDir.path}/${path.basename(file.path)}')..writeAsBytesSync(IM.encodePng(modImage, level:9));
  </code></pre>