diff --git a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs
index 93e2b3fb1..8d97c8b46 100644
--- a/src/ImageSharp/Formats/Bmp/ImageExtensions.cs
+++ b/src/ImageSharp/Formats/Bmp/ImageExtensions.cs
@@ -1,8 +1,8 @@
-// Copyright (c) Six Labors.
+// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.IO;
-
+using System.Threading.Tasks;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Formats.Bmp;
@@ -13,13 +13,64 @@ namespace SixLabors.ImageSharp
///
public static partial class ImageExtensions
{
+ ///
+ /// Saves the image to the given stream with the bmp format.
+ ///
+ /// The image this method extends.
+ /// The file path to save the image to.
+ /// Thrown if the path is null.
+ public static void SaveAsBmp(this Image source, string path) => SaveAsBmp(source, path, null);
+
+ ///
+ /// Saves the image to the given stream with the bmp format.
+ ///
+ /// The image this method extends.
+ /// The file path to save the image to.
+ /// Thrown if the path is null.
+ /// A representing the asynchronous operation.
+ public static Task SaveAsBmpAsync(this Image source, string path) => SaveAsBmpAsync(source, path, null);
+
+ ///
+ /// Saves the image to the given stream with the bmp format.
+ ///
+ /// The image this method extends.
+ /// The file path to save the image to.
+ /// The encoder to save the image with.
+ /// Thrown if the path is null.
+ public static void SaveAsBmp(this Image source, string path, BmpEncoder encoder) =>
+ source.Save(
+ path,
+ encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance));
+
+ ///
+ /// Saves the image to the given stream with the bmp format.
+ ///
+ /// The image this method extends.
+ /// The file path to save the image to.
+ /// The encoder to save the image with.
+ /// Thrown if the path is null.
+ /// A representing the asynchronous operation.
+ public static Task SaveAsBmpAsync(this Image source, string path, BmpEncoder encoder) =>
+ source.SaveAsync(
+ path,
+ encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance));
+
+ ///
+ /// Saves the image to the given stream with the bmp format.
+ ///
+ /// The image this method extends.
+ /// The stream to save the image to.
+ /// Thrown if the stream is null.
+ public static void SaveAsBmp(this Image source, Stream stream) => SaveAsBmp(source, stream, null);
+
///
/// Saves the image to the given stream with the bmp format.
///
/// The image this method extends.
/// The stream to save the image to.
/// Thrown if the stream is null.
- public static void SaveAsBmp(this Image source, Stream stream) => source.SaveAsBmp(stream, null);
+ /// A representing the asynchronous operation.
+ public static Task SaveAsBmpAsync(this Image source, Stream stream) => SaveAsBmpAsync(source, stream, null);
///
/// Saves the image to the given stream with the bmp format.
@@ -32,5 +83,18 @@ namespace SixLabors.ImageSharp
source.Save(
stream,
encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance));
+
+ ///
+ /// Saves the image to the given stream with the bmp format.
+ ///
+ /// The image this method extends.
+ /// The stream to save the image to.
+ /// The encoder to save the image with.
+ /// Thrown if the stream is null.
+ /// A representing the asynchronous operation.
+ public static Task SaveAsBmpAsync(this Image source, Stream stream, BmpEncoder encoder) =>
+ source.SaveAsync(
+ stream,
+ encoder ?? source.GetConfiguration().ImageFormatsManager.FindEncoder(BmpFormat.Instance));
}
-}
\ No newline at end of file
+}