Skip to content

techJmage/ImageConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageConverter Assembly

Namespaces

ImageConverter Namespace

Classes

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

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

input System.Byte[]

The input.

format ImageMagick.MagickFormat

The format.

quality System.Int32

The quality. Default 90. It can be 0 - 100.

Returns

System.Byte[]
converted image data

See Also

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

inputPath System.String

The input path.

outputPath System.String

The output path.

format ImageMagick.MagickFormat

The format.

quality System.Int32

The quality. Default 90. It can be 0 - 100.

See Also

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

inputStream System.IO.Stream

The input stream.

outputStream System.IO.Stream

The output stream.

format ImageMagick.MagickFormat

The format.

quality System.Int32

The quality. Default 90. It can be 0 - 100.

See Also

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages