Skip to content

softawaregmbh/smartcrop.net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smartcrop.net

This is a .NET Standard port of Jonas Wagner's smartcrop.js content aware image cropping library.

Usage

Install the nuget package Smartcrop.net

Add the following code:

using (var image = File.OpenRead(@"path\to\image.jpg"))
{
    // find best crop
    var result = new ImageCrop(200, 200).Crop(image);

    Console.WriteLine(
        $"Best crop: {result.Area.X}, {result.Area.Y} - {result.Area.Width} x {result.Area.Height}");
}

This is a very simple example, all the options from the original project are also available.

Sample

There is also a WPF sample project:

Screenshot of the sample project's UI Image: https://www.flickr.com/photos/endogamia/5682480447 by Leon F. Cabeiro (N. Feans), licensed under CC-BY-2.0

About

A .NET Standard implementation of smartcrop.js for content aware image cropping.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages