sentry-java
sentry-java copied to clipboard
Replay: internal screenshot format
Description
I'm switching Flutter to using onScreenshotRecorded(Bitmap) and I've noticed a degradation in visual quality. I believe it is because the original code, which used the File based API, saved the screenshot to PNG, while the native Bitmap implementation uses JPG.
Previously, with Flutter generated PNG: https://sentry-sdks.sentry.io/replays/2e9baae198384b6387e4e3f497070382/?project=5428562&query=release%3Aoss.krtirtho.spotube.dev%403.9.0-dev%2B38&referrer=%2Freplays%2F%3AreplaySlug%2F&statsPeriod=90d&yAxis=count%28%29&t=0
New, with Android JPG from Bitmap: https://sentry-sdks.sentry.io/replays/0a8ff56225b74dbf93b519043224fe54/?project=5428562&query=release%3Aoss.krtirtho.spotube.dev%403.9.0-dev%2B38&referrer=%2Freplays%2F%3AreplaySlug%2F&statsPeriod=90d&t_main=tags&yAxis=count%28%29&t=2
You can clearly see JPG-specific artifacts in the new version. Interestingly, the new version also results in a video that is larger than previously, at the same resolution, although some of that could be attributed to a slightly different content because the testing app uses random images in button backgrounds.
Have you considered PNG as the screenshot format when saving to file? If not, I'd suggest we evaluate this from the performance perspective, as the quality should be a no-brainer.