//
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
//
namespace ImageSharp
{
using System;
using System.IO;
using Formats;
///
/// Extension methods for the type.
///
public static partial class ImageExtensions
{
///
/// Saves the image to the given stream with the jpeg format.
///
/// The pixel format.
/// The image this method extends.
/// The stream to save the image to.
/// The quality to save the image to. Between 1 and 100.
/// Thrown if the stream is null.
///
/// The .
///
public static Image SaveAsJpeg(this Image source, Stream stream, int quality = 75)
where TColor : struct, IPixel
=> source.Save(stream, new JpegEncoder { Quality = quality });
}
}