Skip to content

Optimize PNG/JPG assets: lossless for docs, lossy for screenshots - #206

Open
adem4ik wants to merge 1 commit into
amule-org:mainfrom
adem4ik:img_opt
Open

adem4ik wants to merge 1 commit into
amule-org:mainfrom
adem4ik:img_opt

Conversation

@adem4ik

@adem4ik adem4ik commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Image Optimization

Images were optimized using 2 different strategies:


1. Documentation Images (/static/img/docs/)

Size diff: 6.8 MiB → 5.7 MiB

Approach: Lossless optimization using File Optimizer (images are pixel-identical to the originals).

Rationale:

  • Chosen mostly for historical reasons
  • These images are already quite small and have their own compression artifacts
  • Lossy recompression would produce significantly more artifacts in this case
  • Docs pages are visited less frequently, so page loading time is less critical here

2. Frontpage Screenshots (static/img/screenshots/)

Size diff: 804 KiB → 463 KiB

Approach: Lossy optimization using pngquant, combined with lossless optimization afterwards.

Command used for pngquant:

pngquant --quality=95-100 --speed=1 --strip --skip-if-larger --ext=.png --force *.png

Rationale:

  • These images are visible on the front page, so page loading time is critically important
  • Upon careful comparison, minor compression artifacts are noticeable on the buttons
  • Text and forms remain mostly unchanged
  • Given the high resolution of the original images (~3200x2000px), most users won't notice the artifacts

Artifacts example:
Снимок экрана_20260902_194257

@ngosang

ngosang commented Sep 2, 2026

Copy link
Copy Markdown
Member

We have to re-do most of the screenshots for the 3.1.0 release. Doing this with images that are going to be removed is wasting space in the git repository.
Maybe you can open a PR improving the documentation about the images? We are using a different software for optimize PNG.
https://github.com/amule-org/amule-org.github.io/blob/main/docs/developer/documentation.md#images

@adem4ik

adem4ik commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@ngosang thanks for the feedback, you can close this PR.

Re: documentation update:

  • File Optimizer is a GUI that bundles several tools (including optipng as noted in your link) and picks the best result. It's Windows-only but works well via Wine on Linux. It's easy to use and supports batch optimization. Should I open a PR adding it as an alternative to the command-line optipng in the docs?
  • Speaking of pngquant alone, it's not a straightforward tool — it can degrade image quality and requires careful parameter tuning depending on the desired outcome, so I wouldn't recommend it for the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants