Skip to content

Seam carving an algorithm for content-aware image resizing.

Notifications You must be signed in to change notification settings

maxim092001/seam-carving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

SeamCarving

Seam carving an algorithm for content-aware image resizing.

The utility was written to compress photos without losing quality in order to lighten the load on the devices of PromoCat users.

More about seam carving algorithm: wiki

Launching

Launch via CLI. Format: java Main -in {in} -out {out} -width {width} -height {heigth}

  • in - input file name in .png format
  • out - output file name in .png format
  • width - the number of pixels to crop in width
  • height - the number of pixels to crop in height

Examples

  • Input image (crop width 125, height 50)

Input image blue

  • Output image

Output image blue

  • Input image (crop width 100, heigth 30)

Input image trees

  • Output image

Output image trees

Compression process

  • Calculate the energy of all pixels.

  • Find the minimum energy path from top to bottom.

  • Remove seam.

  • Similarly, horizontally, paths are searched from left to right and the path is deleted.

  • Energy:

Energy

  • Seam:

Seam

About

Seam carving an algorithm for content-aware image resizing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages