mindee-api-dotnet

ImageCompressor.CompressImage Method

Declaring Type: ImageCompressor
Namespace: Mindee.Image
Assembly: Mindee
Assembly Version: 3.21.0+995c229708fe61b0dacbe0bfca8ad9e39db87623

Overloads

Signature Description
CompressImage(SKBitmap, int, int, int) Resize and\/or compress an SKBitmap. This assumes the ratio was provided before hands.
CompressImage(byte[], int, int?, int?) Resize and\/or compress an image using SkiaSharp. This maintains the provided ratio.

CompressImage(SKBitmap, int, int, int)

Resize and\/or compress an SKBitmap. This assumes the ratio was provided before hands.

public static byte[] CompressImage(SKBitmap original, int quality, int finalWidth, int finalHeight);

Parameters

original SKBitmap

Original, unedited bitmap.

quality int

Quality of the final file.

finalWidth int

Maximum width. If not specified, the horizontal ratio will remain the same.

finalHeight int

Maximum height. If not specified, the vertical ratio will remain the same

Returns

byte[]

A byte array holding a compressed image.

CompressImage(byte[], int, int?, int?)

Resize and\/or compress an image using SkiaSharp. This maintains the provided ratio.

public static byte[] CompressImage(byte[] imageData, int quality = 85, int? maxWidth = null, int? maxHeight = null);

Parameters

imageData byte[]

Byte array representing the content of the image.

quality int

Quality of the final file.

maxWidth Nullable<int>

Maximum width. If not specified, the horizontal ratio will remain the same.

maxHeight Nullable<int>

Maximum height. If not specified, the vertical ratio will remain the same.

Returns

byte[]

A byte array holding a compressed image.


Documentation generated by MdDocs