Skip to content
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

More Emphasis and Benchmarks for Image Size #189

Closed
RehanSaeed opened this issue Apr 26, 2017 · 3 comments
Closed

More Emphasis and Benchmarks for Image Size #189

RehanSaeed opened this issue Apr 26, 2017 · 3 comments
Labels

Comments

@RehanSaeed
Copy link

ImageSharp looks great and has an emphasis on performance. What I can't find is any mention of image size. For static images, I'd run a tool like imagemin to get the size down but in a dynamic scenario, you'd want ImageSharp to generate an image as small as possible in the first place.

There are benchmarks for performance. Can a similar benchmark for image size be created to show image size as compared to System.Drawing and also after using a tool like imagemin?

@JimBobSquarePants
Copy link
Member

@RehanSaeed This more a question for our gitter channel but I'll attempt to answer.

Output size is something we care deeply about and has been a major focus alongside performance. It's not something I would like to spend a great deal of time benchmarking or reporting on though as there's no easy way to report the data.

I'll summarize what we do know now though.

  • Bitmap - There will be no difference since it's an uncompressed format.
  • Jpeg - There's simply too many variables. resampling algorithms, color accuracy. They all contribute to the image size so sometimes we win, sometimes System.Drawing wins.
  • Gif - System.Drawing produces such poor output that such a comparison is meaningless. We however can produce incredibly detailed 256 color output (see the Calliphora fly below) and support animated gifs
  • Png - We use a smarter heuristic algorithm than System.Drawing and will always produce smaller output (~10-15%). We also support smaller indexed pngs and are able to produce images that match the quality, yet beat the size of PngQuant

All in all I believe we do much better than System.Drawing in both quality and size of our image output.

We cannot, however, compete with a dedicated set of tools like ImageMin. ImageMin uses a multitude of different tools that use various techniques (some brute force) to optimize images, none of which can be ran in a particularly performant manner.

Hope that helps

James

Our gif output

calliphora

@RehanSaeed
Copy link
Author

Thanks!

Some idea of where ImageSharp stands in the field in relation to other frameworks is all I wanted. I think a comparison to something like imagemin while I grant you is totally unfair, I still think it acts as a kind of control i.e. this is as small as the image is ever going to get if you threw CPU's at it.

@JimBobSquarePants
Copy link
Member

@RehanSaeed Happy to help! 😄

Yeah, the ImageMin toolset is a great target to aim for. It'll be interesting to see what we can achieve in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants