saharnooby / qoi-java Goto Github PK
View Code? Open in Web Editor NEWA pure Java 8 implementation of Quite OK Image Format
License: MIT License
A pure Java 8 implementation of Quite OK Image Format
License: MIT License
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:
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?
Hey,
I have noticed that there is a bug in the encoder. Specifically https://github.com/saharNooby/qoi-java/blob/main/src/main/java/me/saharnooby/qoi/QOIEncoder.java#L174 here. The original C implementation is using signed arithmetic in this place https://github.com/phoboslab/qoi/blob/master/qoi.h#L465
This may not seem like a big issue since the encoding and decoding seems to be working fine but if you take a .qoi file, decode and then encode it back with this library then the resulting file will not always be identical to the original .qoi file.
You can verify this by performing a test like this:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.