# OfficePngCompression

Defines the zlib compression strategy used when encoding already-filtered PNG scanlines.

Enum 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficePngWriter.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Png/OfficePngWriter.cs#L9)

**Base**

`Enum`

**Implements**

`IComparable` `ISpanFormattable` `IFormattable` `IConvertible`

**Modifiers**

sealed

Defines the zlib compression strategy used when encoding already-filtered PNG scanlines.

## Inheritance

- Enum
- OfficePngCompression

## Usage

Explore 9 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 5

- Property [OfficeImageOptimizationRequest.PngCompression](/api/core/officeimo-drawing-officeimageoptimizationrequest/#property-pngcompression)
- Field [OfficePngCompression.Fastest](/api/core/officeimo-drawing-officepngcompression/#field-fastest)
- Field [OfficePngCompression.Optimal](/api/core/officeimo-drawing-officepngcompression/#field-optimal)
- Field [OfficePngCompression.Stored](/api/core/officeimo-drawing-officepngcompression/#field-stored)
- Property [OfficePngEncodeOptions.Compression](/api/core/officeimo-drawing-officepngencodeoptions/#property-compression)

### Accepted by parameters 4

- Method [OfficePngWriter.Encode](/api/core/officeimo-drawing-officepngwriter/#method-encode-officeimo-drawing-officerasterimage-officeimo-drawing-officepngcompression) parameter `compression`
- Method [OfficePngWriter.EncodeRgba](/api/core/officeimo-drawing-officepngwriter/#method-encodergba-int32-int32-byte-officeimo-drawing-officepngcompression) parameter `compression`
- Method [OfficePngWriter.EncodeScanlines](/api/core/officeimo-drawing-officepngwriter/#method-encodescanlines-int32-int32-int32-int32-byte-officeimo-drawing-officepngcompression) parameter `compression`
- Method [OfficePngWriter.EncodeTo](/api/core/officeimo-drawing-officepngwriter/#method-encodeto-officeimo-drawing-officerasterimage-io-stream-officeimo-drawing-officepngcompression) parameter `compression`

Filter members 

Show inherited

## Inherited Methods

`public int CompareTo(object? target)` [#](#method-compareto-object)

Inherited from Enum

Parameters

**target object? required**

Returns

`int`

`public override bool Equals(object? obj)` [#](#method-equals-object)

Inherited from Enum

Parameters

**obj object? required**

Returns

`bool`

`public override int GetHashCode()` [#](#method-gethashcode)

Inherited from Enum

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public TypeCode GetTypeCode()` [#](#method-gettypecode)

Inherited from Enum

Returns

`TypeCode`

`public bool HasFlag(Enum flag)` [#](#method-hasflag-enum)

Inherited from Enum

Parameters

**flag Enum required**

Returns

`bool`

ToString 4 overloads

`public override string ToString()` [#](#method-tostring)

Inherited from Enum

Returns

`string`

`public string ToString(string? format)` [#](#method-tostring-string)

Inherited from Enum

Parameters

**format string? required**

Returns

`string`

`public string ToString(IFormatProvider? provider)` [#](#method-tostring-iformatprovider)

Inherited from Enum

`Obsolete("The provider argument is not used. Use ToString() instead.")`

Parameters

**provider IFormatProvider? required**

Returns

`string`

`public string ToString(string? format, IFormatProvider? provider)` [#](#method-tostring-string-iformatprovider)

Inherited from Enum

`Obsolete("The provider argument is not used. Use ToString(String) instead.")`

Parameters

**format string? required**

**provider IFormatProvider? required**

Returns

`string`

## Values

`public const OfficePngCompression Optimal` [#](#field-optimal)

[OfficePngWriter.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Png/OfficePngWriter.cs#L15)

Select exact grayscale, RGB, RGBA, or indexed samples and compress according to the selected encoding effort. All RGBA values, including hidden colors under transparent pixels, are preserved.

Value: `0`

`public const OfficePngCompression Stored` [#](#field-stored)

[OfficePngWriter.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Png/OfficePngWriter.cs#L20)

Store scanlines in zlib blocks without deflate compression.

Value: `1`

`public const OfficePngCompression Fastest` [#](#field-fastest)

[OfficePngWriter.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Png/OfficePngWriter.cs#L23)

Compress scanlines once using the platform's fastest deflate strategy.

Value: `2`

<!-- PowerForge markdown artifact sha256:276F0C79558E59D9ECFA998A85695F8A32A84BBE7F737FC8CF7E0DC6688EB4F3 -->
