Skip to content

alexlatz/SeamCarver

Repository files navigation

SeamCarver

GitHub release (latest by date including pre-releases) GitHub

SeamCarver is a JavaFX application that uses the Seam Carver algorithm to scale images without distortion.

Demonstration

To find each seam, the program computes the "energy" value of each pixel as seen in the MERL research paper.

Next, a topological sort finds the smallest energy paths from opposite sides, and removes or adds onto it.

Shrink and Widen

The main difference between this implementation and many others is its ability to bulk-generate the seams.

The algorithm is designed to generate multiple seams and store past additions and deletions in order to create more coherent images.

Diagonal Shrink and Widen

Installation

Download the latest version of SeamCarver from the releases page and run the application (Mac, Linux) or the installer (Windows).

Usage

Open an image using the menu, or use the default image.

Then resize the window to live-resize the image, or use the menu to set a specific size in pixels.

You can then export the image to JPEG, PNG, BMP, or GIF formats.

Building

SeamCarver requires a dual installation of JDK 11 and 14 in order to package the application. 11 needs to be the main JAVA_HOME.

First, set the environment variable BADASS_JLINK_JAVA_HOME to the JDK 14 installation.

Then, run

gradle jpackage -DinstallerType='insert installer type here'

(Replace gradle with gradlew.bat on Windows)

Installer types can be exe on Windows, dmg on macOS, and deb or rpm on Linux.

After building, the binaries can be found in SeamCarver/build/jpackage.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Licence

GNU GPLv3