// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp { using System; using Processing.Processors; /// /// Extension methods for the type. /// public static partial class ImageExtensions { /// /// Crops an image to the area of greatest entropy. /// /// The pixel format. /// The image to crop. /// The threshold for entropic density. /// The public static Image EntropyCrop(this Image source, float threshold = .5f) where TColor : struct, IPackedPixel, IEquatable { EntropyCropProcessor processor = new EntropyCropProcessor(threshold); source.ApplyProcessor(processor, source.Bounds); return source; } } }