/seam-carving

Content-aware image resizing

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

SeamCarving

Content-aware image resizing.

Introduction

Seam carving is the resizing of images by removing the lowest-energy vertical and horizontal "seams."

This allows for dynamic resizing of existing images to fit a wide variety of screens and panels.

More Information

An excellent discussion of seam carving can be found at Princeton's Algorithms and Data Structures, Part II website.

A dynamic demonstration of seam carving is also available on YouTube.

Motivation

This project was completed for Algorithms, Part II.

If you're in that course or related course right now, obey all honor code requirements before viewing this code.
I recommend that this code should only be viewed after you've completed your own implementation.
If you're super stuck, take a break, take a walk, and it will come to you; good luck.

Sample Resizings

These images were produced using the ResizeDemo.java source file, available in the seamCarving-testing.zip file supplied by Princeton.

Original:
Original Surfers
Source

Resized:
Resized Surfers

Original:
Original Fleet
Source
By U.S. Navy photo by Mass Communication Specialist 3rd Class Ryan Steinhour [Public domain], via Wikimedia Commons

Resized:
Resized Fleet

Original:
Original Panorama
Source
Mjones3137 at English Wikipedia CC BY 3.0, via Wikimedia Commons

Resized:
Resized Panorama

Original:
Original Camel on Sand Dune
Source
By Peter Gronemann from Switzerland (Camel on a sand dune) CC BY 2.0, via Wikimedia Commons

Resized:
Resized Camel on Sand Dune

Original:
Original Banff
Source

Resized:
Resized Banff