qoi-java icon indicating copy to clipboard operation
qoi-java copied to clipboard

Question: Not worth to use QOI decoding over PNG decoding on Android?

Open AndroidDeveloperLB opened this issue 2 years ago • 8 comments

Whether I use QOIUtil.readFile vs BitmapFactory.decodeFile of Android, or I use QOIUtil.readImage vs BitmapFactory.decodeStream , it seems that Android's implementation is faster to parse PNG files over QOI:

From inputStream of the resource (files are within the app) : QOI took 84 ms PNG took 25 ms

From a file outside the app: QOI took 36 ms PNG took 30 ms

And that's before getting Bitmap instance out of the QOIImage instance, which I don't understand how to do.

Tested on Pixel 4 with Android API 32 on the "wikipedia_008" image files, from here (got from here) : https://qoiformat.org/qoi_test_images.zip

See attached project:

My Application.zip

How could it be? Is there anything that can be improved in the implementation? And how do you convert the output of the function to a working Bitmap instance?

AndroidDeveloperLB avatar Apr 02 '22 20:04 AndroidDeveloperLB