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

Feature Proposal: Rasterization of SVGs at Runtime for Eclipse Icons #2593

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Michael5601
Copy link

See the following PR in Eclipse SWT for a detailed description of the changes.

Fixes eclipse-platform/eclipse.platform.swt#1438.

@HannesWell
Copy link
Member

I just pushed the changes I made for/in our yesterdays 1:1 meeting, mainly adapt to the change that o.e.swt.svg is a fragment.

Copy link
Contributor

github-actions bot commented Dec 17, 2024

Test Results

0 files   -  1 818  0 suites   - 1 818   0s ⏱️ - 1h 30m 14s
0 tests  -  7 739  0 ✅  -  7 511  0 💤  - 228  0 ❌ ±0 
0 runs   - 24 378  0 ✅  - 23 629  0 💤  - 749  0 ❌ ±0 

Results for commit 27e477f. ± Comparison against base commit d6af2f2.

♻️ This comment has been updated with latest results.

@Michael5601
Copy link
Author

I removed the added SVGs from this PR. Please see the new PR for the SVGs if you want to test this feature.

In the meantime I locally changed all PNGs I could find in Platform UI, Platform, JDT UI and SWT for testing the Performance. I had no problems whatsoever when starting Eclipse and it was also quite easy and fast to add the SVGs and change the paths. I did not delete any PNGs in this process but changed ".png" to ".svg" in most places.

I will report the performance data soon.

Feature Proposal: Rasterization of SVGs at Runtime for Eclipse Icons
Fixes eclipse-platform#1438

Eclipse currently loads icons exclusively as raster graphics (e.g., `.png`), without support for vector formats like `.svg`. A major drawback of raster graphics is their inability to scale without degrading image quality. Additionally, generating icons of different sizes requires manually rasterizing SVGs outside Eclipse, leading to unnecessary effort and many icon files.

This PR introduces support for vector graphics in Eclipse, enabling SVGs to be used for icons. Existing PNG icons will continue to be loaded alongside SVGs, allowing the use of the new functionality without the need to replace all PNG files at once.

---
- **How It Works**:
  - To use SVG icons, simply place the SVG file in the bundle and reference it in the `plugin.xml` and other necessary locations, as is done for PNGs. No additional configuration is required.
  - At runtime, Eclipse uses the library JSVG to rasterize the SVG into a raster image of the desired size, eliminating the need for scaling. My analysis shows that JSVG is the most suitable Java library for this purpose.
  - You need to write the flag `-Dswt.autoScale=quarter` into your `eclipse.ini` file or into the run arguments of a new configuration.
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.

Improving Eclipse Icon Scaling by Supporting Vectorized Icons
2 participants