In dart, create JPEG file is like:import 'dart:io';
import 'package:image/image.dart';
...
ListresizedBytes = encodeJpg(resizedImage);
File(outputPath).writeAsBytesSync(resizedBytes)In python, we usually use:import cv2
...
cv2.imwrite("output.jpg", output_image)But they are different! As thesource codeshow, the “encodeJpg()” use 100% quality and YUV444 chroma as default, but cv2 use95%quality andYUV420chroma as default.If you want to write a JPEG file just as “encodeJpg()” do by using python, the code snippet should be:import cv2
...
params = [cv2.IMWRITE_JPEG_QU
...
继续阅读
(3)