The Seamstress Library

Hayden Walles1

Copyright © 2007 Hayden Walles.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

Seamstress is an open source library for image seam carving. Seam carving is a technique described by Avidan and Shamir [1] for changing the size or shape of an image without necessarily changing the size or shape of the things in the image. The best way to explain is with some examples. The images2 in Figures 1 and 2 show how seam carving can be used to resize an image. In a nutshell seam carving resizes images by taking out the “boring bits”.

Figure 1: The image on the right was created by removing seams from the image on the left. Blue sky remains at the top of the picture, but the bridge remains the same size. “Bridge” was taken in the Copland Valley on the West Coast of New Zealand by flickr user Tom@North (

Image valley Image valley_carved

Figure 2: The image on the right was created by removing seams from the image on the left. The swans remain the same size and shape but appear closer together - only the water has been shrunk. “Birds @ Otago Peninsular, New Zealand” was taken on Otago Peninsula, New Zealand by flickr user timparkinson (
Image swans Image swans_carved

This document is a programming guide to the Seamstress library. You don't need to read it if you just want to use programs developed using the library. Sections 1-3 describe seam carving and the general capabilities of Seamstress. Section 4 is a combined guide and reference to the functionality of the the library.

To get Seamstress and also Arachne, a program that demonstrates the library at work, visit the project website at

Hayden Walles 2015-09-02 Logo