ImageConverter 1.0.0
dotnet add package ImageConverter --version 1.0.0
NuGet\Install-Package ImageConverter -Version 1.0.0
<PackageReference Include="ImageConverter" Version="1.0.0" />
paket add ImageConverter --version 1.0.0
#r "nuget: ImageConverter, 1.0.0"
// Install ImageConverter as a Cake Addin #addin nuget:?package=ImageConverter&version=1.0.0 // Install ImageConverter as a Cake Tool #tool nuget:?package=ImageConverter&version=1.0.0
ImageConverter
ImageConverter Assembly
Namespaces
<a name='ImageConverter'></a>
ImageConverter Namespace
Classes
<a name='ImageConverter.Convert'></a>
Convert Class
A simple image converter
public class Convert
Inheritance System.Object 🡒 Convert
Example
Usage as follows:
public void ToWebpTest(string inputPath, string outputPath)
{
Convert.To(inputPath, outputPath, ImageMagick.MagickFormat.WebP);
Assert.IsTrue(File.Exists(outputPath));
var fi = new FileInfo(outputPath);
Console.WriteLine(fi.Length);
Assert.IsTrue(fi.Length > 1);
}
Remarks
For supported formats refer to
ImageMagick.MagickFormat
See Also
Methods
<a name='ImageConverter.Convert.To(byte[],ImageMagick.MagickFormat,int)'></a>
Convert.To(byte[], MagickFormat, int) Method
Convert an image data of any popular format to another format data
public static byte[] To(byte[] input, ImageMagick.MagickFormat format=ImageMagick.MagickFormat.Png, int quality=90);
Parameters
<a name='ImageConverter.Convert.To(byte[],ImageMagick.MagickFormat,int).input'></a>
input
System.Byte[]
The input.
<a name='ImageConverter.Convert.To(byte[],ImageMagick.MagickFormat,int).format'></a>
format
ImageMagick.MagickFormat
The format.
<a name='ImageConverter.Convert.To(byte[],ImageMagick.MagickFormat,int).quality'></a>
quality
System.Int32
The quality. Default 90. It can be 0 - 100.
Returns
System.Byte[]
converted image data
See Also
<a name='ImageConverter.Convert.To(string,string,ImageMagick.MagickFormat,int)'></a>
Convert.To(string, string, MagickFormat, int) Method
Convert an input image from a specified path to any popular format and save to another specified path
public static void To(string inputPath, string outputPath, ImageMagick.MagickFormat format=ImageMagick.MagickFormat.Png, int quality=90);
Parameters
<a name='ImageConverter.Convert.To(string,string,ImageMagick.MagickFormat,int).inputPath'></a>
inputPath
System.String
The input path.
<a name='ImageConverter.Convert.To(string,string,ImageMagick.MagickFormat,int).outputPath'></a>
outputPath
System.String
The output path.
<a name='ImageConverter.Convert.To(string,string,ImageMagick.MagickFormat,int).format'></a>
format
ImageMagick.MagickFormat
The format.
<a name='ImageConverter.Convert.To(string,string,ImageMagick.MagickFormat,int).quality'></a>
quality
System.Int32
The quality. Default 90. It can be 0 - 100.
See Also
<a name='ImageConverter.Convert.To(System.IO.Stream,System.IO.Stream,ImageMagick.MagickFormat,int)'></a>
Convert.To(Stream, Stream, MagickFormat, int) Method
Convert an image stream of any popular format to another format stream
public static void To(System.IO.Stream inputStream, System.IO.Stream outputStream, ImageMagick.MagickFormat format=ImageMagick.MagickFormat.Png, int quality=90);
Parameters
<a name='ImageConverter.Convert.To(System.IO.Stream,System.IO.Stream,ImageMagick.MagickFormat,int).inputStream'></a>
inputStream
System.IO.Stream
The input stream.
<a name='ImageConverter.Convert.To(System.IO.Stream,System.IO.Stream,ImageMagick.MagickFormat,int).outputStream'></a>
outputStream
System.IO.Stream
The output stream.
<a name='ImageConverter.Convert.To(System.IO.Stream,System.IO.Stream,ImageMagick.MagickFormat,int).format'></a>
format
ImageMagick.MagickFormat
The format.
<a name='ImageConverter.Convert.To(System.IO.Stream,System.IO.Stream,ImageMagick.MagickFormat,int).quality'></a>
quality
System.Int32
The quality. Default 90. It can be 0 - 100.
See Also
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Magick.NET-Q8-AnyCPU (>= 13.9.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ImageConverter:
Package | Downloads |
---|---|
HtmlToPdfMaker
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 118 | 7/7/2024 |