2021年4月6日星期二

Flutter ui.ImageByteFormat.rawRgba has terrible Image Quality

In my project, I need to capture the frame of a flutter animation and save that frame as an image (probably in .png) to Device Storage.

I am using RepaintBoundary to capture the frame, but I can't use the ui.ImageByteFormat.png method because it takes a lot of process time to capture the frame as a .png, and since I need to take a lot of frames it will not be a viable solution. Instead, I am using ui.ImageByteFormat.rawRgba which is super fast but when I save it to Storage the image quality is terrible. It hardly looks like it's the same image I captured.

I am using FFMPEG to convert .raw or .bmp format to png and save it to storage.

In both cases, using raw or using BitMap the output image is like this:

enter image description here

But, the Quality of the Image should be like this enter image description here

Now, I need help to either get this raw capture saved with quality by using whatever file format doesn't matter or please share if you have any other viable method to capture frames of a flutter animation.

https://stackoverflow.com/questions/66937902/flutter-ui-imagebyteformat-rawrgba-has-terrible-image-quality April 04, 2021 at 11:59AM

没有评论:

发表评论