diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index a9aac5efa..c0e072098 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -127,7 +127,7 @@ namespace ImageSharp.Formats + $"bigger then the max allowed size '{Image.MaxWidth}x{Image.MaxHeight}'"); } - Image image = Image.Create(this.infoHeader.Width, this.infoHeader.Height, this.configuration); + Image image = new Image(this.infoHeader.Width, this.infoHeader.Height, this.configuration); using (PixelAccessor pixels = image.Lock()) { switch (this.infoHeader.Compression) diff --git a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs index 589b7037a..e11c66248 100644 --- a/src/ImageSharp/Formats/Gif/GifDecoderCore.cs +++ b/src/ImageSharp/Formats/Gif/GifDecoderCore.cs @@ -366,7 +366,7 @@ namespace ImageSharp.Formats this.metaData.Quality = colorTableLength / 3; // This initializes the image to become fully transparent because the alpha channel is zero. - this.image = Image.Create(imageWidth, imageHeight, this.metaData, this.configuration); + this.image = new Image(imageWidth, imageHeight, this.metaData, this.configuration); this.SetFrameMetaData(this.metaData); diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs index 9df21a3b7..ed365ec65 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs @@ -482,7 +482,7 @@ namespace ImageSharp.Formats private Image ConvertJpegPixelsToImagePixels(ImageMetaData metadata) where TPixel : struct, IPixel { - Image image = Image.Create(this.ImageWidth, this.ImageHeight, metadata, this.configuration); + Image image = new Image(this.ImageWidth, this.ImageHeight, metadata, this.configuration); if (this.grayImage.IsInitialized) { diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index 904aa1ff6..a264c8d0c 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -335,7 +335,7 @@ namespace ImageSharp.Formats throw new ArgumentOutOfRangeException($"The input png '{this.header.Width}x{this.header.Height}' is bigger than the max allowed size '{Image.MaxWidth}x{Image.MaxHeight}'"); } - image = Image.Create(this.header.Width, this.header.Height, metadata, this.configuration); + image = new Image(this.header.Width, this.header.Height, metadata, this.configuration); pixels = image.Lock(); this.bytesPerPixel = this.CalculateBytesPerPixel(); this.bytesPerScanline = this.CalculateScanlineLength(this.header.Width) + 1; diff --git a/src/ImageSharp/Image/Image.Create.cs b/src/ImageSharp/Image/Image.Create.cs deleted file mode 100644 index 82ebecd41..000000000 --- a/src/ImageSharp/Image/Image.Create.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// Copyright (c) James Jackson-South and contributors. -// Licensed under the Apache License, Version 2.0. -// - -namespace ImageSharp -{ - using ImageSharp.PixelFormats; - - /// - /// Adds static methods allowing the creation of new images from given dimensions. - /// - public static partial class Image - { - /// - /// Create a new instance of the class with the given height and the width. - /// - /// The width of the image in pixels. - /// The height of the image in pixels. - /// - /// The configuration providing initialization code which allows extending the library. - /// - /// The pixel format. - /// - /// A new . - /// - internal static Image Create(int width, int height, Configuration configuration) - where TPixel : struct, IPixel - { - return Create(width, height, null, configuration); - } - - /// - /// Create a new instance of the class with the given height and the width. - /// - /// The width of the image in pixels. - /// The height of the image in pixels. - /// The images matadata to preload. - /// - /// The configuration providing initialization code which allows extending the library. - /// - /// The pixel format. - /// - /// A new . - /// - internal static Image Create(int width, int height, ImageMetaData metadata, Configuration configuration) - where TPixel : struct, IPixel - { - return new Image(width, height, metadata, configuration); - } - } -} \ No newline at end of file