Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compression of README GIFs #6

Closed
gezeta-id opened this issue Dec 18, 2024 · 5 comments
Closed

Compression of README GIFs #6

gezeta-id opened this issue Dec 18, 2024 · 5 comments
Assignees
Labels
prio:medium Medium priority status:done Task completed successfully type:docs Improvements or additions to documentation

Comments

@gezeta-id
Copy link

gezeta-id commented Dec 18, 2024

Hi.

Some people were complaining about the images in the README taking a while to load or not even loading at all sometimes.

As a suggestion, you may want to consider compressing the GIFs.

In case you're interested, I've done a quick and dirty test and it brings the size from ~23MB to ~10MB which is a nice improvement without bringing down the quality too much.

If you want them, here are the compressed images:

1
2
3
4
5
6

@brenocq
Copy link
Owner

brenocq commented Dec 18, 2024

I did see some comments about it. Thank you for taking the initiative to compress the GIFs! I'll update the README with your GIFs shortly :)

@gezeta-id
Copy link
Author

My pleasure. It's the least I could do )

@brenocq brenocq assigned brenocq and gezeta-id and unassigned brenocq Dec 19, 2024
@brenocq brenocq added the type:docs Improvements or additions to documentation label Dec 19, 2024
@brenocq brenocq changed the title Consider reducing the size of the GIFs in the README. Compression of README GIFs Dec 20, 2024
@brenocq
Copy link
Owner

brenocq commented Dec 21, 2024

Hi @gezeta-id!

I was checking your GIFs and I noticed that we can compress it even further. Because I still have the original videos, I converted them again to .gif, but this time I tried to optimize it for size:

  • Downscaled from 485x368 to 270x205 (width is fixed by the README)
  • Decreased FPS from 12 to 10
  • Decrease quality from 100 to 70

These were the commands I used:

ffmpeg -i surfaceplot.apng -vf "fps=10,scale=270:-1:flags=lanczos" frames/frame_%04d.png
gifski -o surfaceplot.gif --fps 10 --quality 70 frames/frame_*.png

Before (~22.6MB)

  • duckplot.gif4.3 MB
  • lineplot.gif3.2 MB
  • markerplot.gif1.6 MB
  • scatterplot.gif2.8 MB
  • sphereplot.gif5.6 MB
  • surfaceplot.gif5.1 MB

After (~5.15MB ~4.4x smaller)

  • duckplot_low.gif757 KB (5.7x smaller)
  • lineplot_low.gif679 KB (4.7x smaller)
  • markerplot_low.gif575 KB (2.8x smaller)
  • scatterplot_low.gif639 KB (4.4x smaller)
  • sphereplot_low.gif1.1 MB (5.1x smaller)
  • surfaceplot_low.gif1.4 MB (3.6x smaller)

brenocq added a commit that referenced this issue Dec 21, 2024
Thanks to @gezeta-id for the initial work in #6
@brenocq
Copy link
Owner

brenocq commented Dec 21, 2024

The GIFs were updated in the README in the commit 0fd0651!

Thank you for helping improve ImPlot3D, @gezeta-id! Feel free to check out the discussions if you're interested in contributing to new features 🙂

@brenocq brenocq closed this as completed Dec 21, 2024
@brenocq brenocq self-assigned this Dec 21, 2024
@brenocq brenocq added the prio:medium Medium priority label Dec 21, 2024
@gezeta-id
Copy link
Author

After (~5.15MB ~4.4x smaller)

That's great! Much, much better than my attempt :)

Happy to see it loading so fast in the readme now.

@brenocq brenocq added the status:done Task completed successfully label Dec 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
prio:medium Medium priority status:done Task completed successfully type:docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants