https://github.com/sonnyp/OhMySVG
Reduce the size of SVGs
https://github.com/sonnyp/OhMySVG
gjs gnome gtk linux-app svg
Last synced: 5 months ago
JSON representation
Reduce the size of SVGs
- Host: GitHub
- URL: https://github.com/sonnyp/OhMySVG
- Owner: sonnyp
- License: gpl-3.0
- Created: 2021-07-10T10:31:40.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T17:36:20.000Z (6 months ago)
- Last Synced: 2024-12-01T04:39:09.756Z (5 months ago)
- Topics: gjs, gnome, gtk, linux-app, svg
- Language: JavaScript
- Homepage:
- Size: 2.69 MB
- Stars: 92
- Watchers: 4
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: COPYING
Awesome Lists containing this project
README
# Oh My SVG
Reduce the size of SVGs

## About
Oh My SVG let you export unoptimized SVG files into smaller versions.
Under the hood, it uses [SVGO](https://github.com/svg/svgo/) to remove or approximate information that is not required for rendering.
It lets you preview and tweak the parameters to obtain a satisfactory result before saving.
Remember that Oh My SVG removes information and metadata that may be useful, do not overwrite your original/source SVG files.
## Installation
[Setup flatpak](https://flatpak.org/setup/) then
```sh
flatpak install re.sonny.OhMySVG
flatpak run re.sonny.OhMySVG
```## Roadmap
- better icon
- zoom in and out
- out of process svgo
- toggling switches not smooth
- block UI threads
- rasterize
- Export to png
- Export to webp
- UI
- Filename as headedr bar subtitle
- Already optimized 🎉
- basic/advanced plugins
- support drag'n drop file https://gitlab.gnome.org/GNOME/gtk/-/issues/3094
- support pasting file
- support copying file
- show original / compare original
- preview in browser
- compared gzipped## Development
```sh
cd OhMySVG
./re.sonny.OhMySVG src/car-lite.svg
```Make changes and hit `Ctrl+Shift+Q` on the window to restart the application.
To pass the tests you have to install a few dependencies:
```sh
# Install development dependencies with dnf (Fedora)
sudo dnf install --assumeyes npm flatpak make desktop-file-utils gjs gtk4-devel libadwaita-devel# Install development dependencies with apt (Debian, Ubuntu)
sudo apt-get install --assume-yes npm flatpak make desktop-file-utils gjs libgtk-4-dev libadwaita-1-dev# The rest is distribution-agnostic once other dependencies have been resolved
npm install
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user --assumeyes --noninteractive flathub org.freedesktop.appstream-glib# Run tests, may fail in sandboxed environments (i.e. Snap/Flatpak)
make test
```Flathub builds https://flathub.org/builds/#/apps/re.sonny.OhMySVG
## Building
host
```sh
meson --prefix $PWD/install build
ninja -C build install
```Flatpak
Use [GNOME Builder](https://wiki.gnome.org/Apps/Builder) or
```sh
flatpak-builder --user --force-clean --install-deps-from=flathub --install flatpak re.sonny.OhMySVG.json
```## Credits
Oh My SVG is powered by [SVGO](https://github.com/svg/svgo) and inspired by [SVGOMG](https://github.com/jakearchibald/svgomg).
## License
GPLv3. Please see [COPYING](COPYING) file.
## Bookmarks
- https://css-tricks.com/understanding-and-manually-improving-svg-optimization/
- https://github.com/RazrFalcon/svgcleaner