diff --git a/src/ImageSharp.Formats.Gif/GifDecoder.cs b/src/ImageSharp.Formats.Gif/GifDecoder.cs index ce97689e9..88a3d5e43 100644 --- a/src/ImageSharp.Formats.Gif/GifDecoder.cs +++ b/src/ImageSharp.Formats.Gif/GifDecoder.cs @@ -19,7 +19,20 @@ namespace ImageSharp.Formats { IGifDecoderOptions gifOptions = GifDecoderOptions.Create(options); - new GifDecoderCore(gifOptions).Decode(image, stream); + this.Decode(image, stream, gifOptions); + } + + /// + /// Decodes the image from the specified stream to the . + /// + /// The pixel format. + /// The to decode to. + /// The containing image data. + /// The options for the decoder. + public void Decode(Image image, Stream stream, IGifDecoderOptions options) + where TColor : struct, IPackedPixel, IEquatable + { + new GifDecoderCore(options).Decode(image, stream); } } } diff --git a/src/ImageSharp.Formats.Png/PngDecoder.cs b/src/ImageSharp.Formats.Png/PngDecoder.cs index c731ae448..658de9e66 100644 --- a/src/ImageSharp.Formats.Png/PngDecoder.cs +++ b/src/ImageSharp.Formats.Png/PngDecoder.cs @@ -36,7 +36,20 @@ namespace ImageSharp.Formats { IPngDecoderOptions pngOptions = PngDecoderOptions.Create(options); - new PngDecoderCore(pngOptions).Decode(image, stream); + this.Decode(image, stream, pngOptions); + } + + /// + /// Decodes the image from the specified stream to the . + /// + /// The pixel format. + /// The to decode to. + /// The containing image data. + /// The options for the decoder. + public void Decode(Image image, Stream stream, IPngDecoderOptions options) + where TColor : struct, IPackedPixel, IEquatable + { + new PngDecoderCore(options).Decode(image, stream); } } }