New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments: Comparing Performance: stb_image vs libjpeg(-turbo), libpng and lodepng #9
Comments
Hello Daniel, first I would like to say that I really liked the comparison present on the site since I am deciding which library to However, my results were different from yours with respect to JPEG (more specifically libjpeg-turbo vs stb_image). I did tests in 2 scenarios, both with consecutive readings of 17 images of 4608x2592 with stb_image latest version (v2.26)
Interesting isn't it? I don't know exactly what has changed but it seems that the difference between libjpeg-turbo and stb_image has become bigger, which may not be as interesting for those who need the best possible performance. |
Hi Theldus, yes, it seems like the gap has become wider - I guess that libjpeg-turbo has gotten additional optimization in the last years - keep in mind that my test was 6 years ago, and the libjpeg-turbo release I was using (1.3.0) is already 8 years old. Another factor in my tests was the image size - for the big (4000x3000px) image stb_image took 23% longer than libjpeg-turbo, for the small (512x512px) image it was much closer (3.7%-16%). It's true that stb_image is not (and never was) the best solution if you need the best possible performance, but often it's good enough. I personally avoid libjpeg if possible at all, because its API is less friendly and its different incompatible versions are such a pain in the ass: Most Linux distros ship libjpeg-turbo with a (slightly enhanced) jpeg6.2 API as their default libjpeg, but Ubuntu ships it in the (incompatible!) jpeg8 API, so
If you want the best possible performance in loading images (or textures) in a 3D-accelerated context, I'd suggest looking at Basis Universal. |
Hi, I didn't know about the differences between API in libjpeg, perhaps the best approach is to support both libraries and let the user decide, maybe using stb_image as a default. Anyway, thanks for the suggestions, I was just playing around with the libraries and seeing what I got from them, but for something more serious I will consider them =). |
Comments for https://blog.gibson.sh/2015/03/23/comparing-performance-stb_image-vs-libjpeg-turbo-libpng-and-lodepng/
The text was updated successfully, but these errors were encountered: