PixarAnimationStudios / OpenSubdiv

An Open-Source subdivision surface library.
graphics.pixar.com/opensubdiv
Other
2.88k stars 558 forks source link

Optimize PNGs to save 5MB+ losslessly #1331

Open C0rn3j opened 5 months ago

C0rn3j commented 5 months ago

Exact commands as per https://rys.rs/optimization

Shouldn't break anything, file savings are all lossless with no effect on quality.

I did also correct a PNG that had a .jpg extension and edited its associated .rst mention.

davidgyu commented 5 months ago

Filed as internal issue #OSD-440

davidgyu commented 5 months ago

We'll need a signed Contributor License Agreement from you for this PR. Thanks!

C0rn3j commented 5 months ago

CLA signed

davidgyu commented 5 months ago

Many of these image files have been autogenerated by external tools and we'll have to consider whether we want to take on this additional optimization step. The overall note that many of these image files take up more space than is needed is a great observation and something that we should definitely consider as we add or update content in the future.

C0rn3j commented 5 months ago

It certainly would be a good idea to implement a solution to prevent pushing new files with the same issue.

One solution that comes to mind:

There are possibly better ways to do this, it's just an idea I was pondering while sending out patches like these.

Though, even without any future-proof solution being implemented, pulling in this one-time run would help a fair bitas it targets images across the last 12+ years.
For example, my distribution ships OpenSubdiv along with the documentation, so the resulting installation size is needlessly large without it.