diff --git a/src/ImageProcessorCore/ImageExtensions.cs b/src/ImageProcessorCore/ImageExtensions.cs index 597c681df2..025c739b97 100644 --- a/src/ImageProcessorCore/ImageExtensions.cs +++ b/src/ImageProcessorCore/ImageExtensions.cs @@ -30,8 +30,11 @@ namespace ImageProcessorCore /// /// The image this method extends. /// The stream to save the image to. + /// The quality to save the image to representing the number of colors. + /// Anything equal to 256 and below will cause the encoder to save the image in an indexed format. + /// /// Thrown if the stream is null. - public static void SaveAsPng(this ImageBase source, Stream stream) => new PngEncoder().Encode(source, stream); + public static void SaveAsPng(this ImageBase source, Stream stream, int quality = int.MaxValue) => new PngEncoder { Quality = quality }.Encode(source, stream); /// /// Saves the image to the given stream with the jpeg format. @@ -47,7 +50,7 @@ namespace ImageProcessorCore /// /// The image this method extends. /// The stream to save the image to. - /// The quality to save the image to representing the number of colors. Between 1 and 100. + /// The quality to save the image to representing the number of colors. Between 1 and 256. /// Thrown if the stream is null. public static void SaveAsGif(this ImageBase source, Stream stream, int quality = 256) => new GifEncoder { Quality = quality }.Encode(source, stream);