GithubHelp home page GithubHelp logo

mcanthony / seam-carve-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattmight/seam-carve-js

0.0 2.0 0.0 548 KB

A small web app to demonstrate the seam-carving algorithm in JavaScript.

HTML 9.74% JavaScript 90.26%

seam-carve-js's Introduction

Seam Carving in JavaScript

Seam carving is a technique for resizing an image while intelligently preserving "important" content such as people or structures.

Shai Avidan and Ariel Shamir published a SIGGRAPH 2007 paper describing the algorithm.

When an image needs to contract, the algorithm finds a connected "seam" in the image running edge to edge along a "path of least importance."

Importance is determined by an energy function that assigns a cost to each pixel.

The code illustrates exposes phase of the algorithm as a separate image:

  1. Conversion to grayscale.
  2. Computation of the gradient magnitude.
  3. Finding the minimal seam.
  4. Carving out the seam.

It makes extensive use of the HTML5 canvas element.

The code is not geared toward efficiency, but rather, human readability.

My goal was to make the algorithm itself as clear as possible.

The tower image is from Wikipedia.

seam-carve-js's People

Contributors

mattmight avatar

Watchers

 avatar  avatar

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.