Skip to content

sonnyp/OhMySVG

Repository files navigation

Oh My SVG

Reduce the size of SVGs

screenshot

Download on Flathub

About

Oh My SVG let you export unoptimized SVG files into smaller versions.

Under the hood, it uses 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 then

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

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:

# 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
meson --prefix $PWD/install build
ninja -C build install
Flatpak

Use GNOME Builder or

flatpak-builder --user --force-clean --install-deps-from=flathub --install flatpak re.sonny.OhMySVG.json

Credits

Oh My SVG is powered by SVGO and inspired by SVGOMG.

License

GPLv3. Please see COPYING file.

Bookmarks