Giter VIP home page Giter VIP logo

lukaj's Introduction

Interactive diff tool for SVG images.

Crates.io CI - Main License Coverage Status

Features

Swipe SVG graphics comparison with zoom and drag support.

Installation

To install precompiled version of lukaj go to latest release page and download archive for your system. Provided binaries are static executables for Windows and Linux.

If you're a Rust programmer, lukaj can be installed with cargo. It supports two graphics backends which are enabled/disabled with cargo features. The use-rsvg feature is available only when installing from source, precompiled binaries on release page include only default feature set.

Feature name SVG library 2D rendering library Precompiled binary release
use-usvg (default) resvg tiny-skia yes
use-rsvg librsvg cairo no

Depending on the operating system and selected feature set, lukaj will require additional development libraries.

On Ubuntu Linux (click to expand)
  1. When using only default use-usvg feature:

    $ sudo apt-get install libsdl2-dev
    $ cargo install lukaj
  2. When using additional use-rsvg feature:

    $ sudo apt-get install build-essential libcairo2-dev libgdk-pixbuf-2.0-dev \
        libglib2.0-dev libpango1.0-dev libsdl2-dev libxml2-dev
    $ cargo install lukaj --feature user-rsvg
On Windows (using MSYS2) (click to expand)
  1. Install MSYS2 and run from it's terminal run:

    • For default use-usvg feature:

      $ pacman -S mingw-w64-x86_64-SDL2
    • For additional use-rsvg feature:

      $ pacman -S mingw-w64-x86_64-gtk4 mingw-w64-x86_64-gettext \
          mingw-w64-x86_64-libxml2 mingw-w64-x86_64-pkgconf \
          mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2
  2. Add mingw binaries path (C:\msys64\mingw64\bin) to system Path

  3. Change default rust toolchain to stable-gnu

    rustup toolchain install stable-gnu
    rustup default stable-gnu
  4. Run cargo install command

    • For default feature only:

      $ cargo install lukaj
    • For additional use-rsvg feature:

      $ cargo install lukaj --features use-rsvg

For different setups see this GUI development with Rust and GTK4 guide.

Usage

To compare two SVG files run:

$ lukaj [path 1] [path 2]

Lukaj uses following mouse/keyboard controls:

Button Action
Left Click Move diff separator
Right Click Move images
Scroll Zoom in and out
R Reset images position
Esc Exit
Complete lukaj options (click to expand)
$ lukaj --help
Interactive diff tool for SVG images

Usage: lukaj [OPTIONS] [FILES]...

Arguments:
  [FILES]...  Files to compare

  Options:
    -s, --scale <VALUE>      Sets a scaling factor
    --backend <BACKEND>      Preferred backend [default: rsvg-with-cairo]
                             [possible values: rsvg-with-cairo, usvg-with-skia]
    -h, --help               Print help
    -V, --version            Print version

Git integration

Lukaj can be used as git difftool. To add git diff-svg custom command, copy and paste following sections to .gitconfig file:

[difftool "lukaj"]
    cmd = ~/.cargo/bin/lukaj $LOCAL $REMOTE
[alias]
    diff-svg = "difftool -t lukaj -y"

Other integrations

lukaj's People

Contributors

adamws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lukaj's Issues

Project roadmap

Things I want to add in upcoming versions:

  • prevent crashes for large zooms
    • initially set some sane limit b169fe1 f869485
    • implement rendering parts of SVG - render only part visible in window so the texture does not exceeds memory capabilities
  • add help menu overlay (for displaying navigation keys etc)
  • support piping files (see https://stackoverflow.com/questions/9847479/use-pipe-of-commands-as-argument-for-diff)
  • add status bar 2ff755f
    • display cursor coordinates
    • display split coordinate
  • allow to adjust offset between images for comparison of specific zones
  • add menu which lets to open files after executable launched
  • add texture caching for performance improvement (check if really needed)
  • make sure it works on windows and ios
  • prepare pre-built binaries for supported platforms 1804ccc
  • add different comparison modes
  • add support for more image formats
  • zoom with rectangle select and not only with scroll-wheel
  • indicate if SVGs are identical f585cc3
  • add more configuration options
    • white background instead of checkerboard
    • color of split separator
  • implement smart separator color - sections of separator could change color to provide better contrast if blending with compared images

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.