---
title: "PngEncoderOptions Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_PngEncoderOptions.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# PngEncoderOptions Class
 
This class holds PNG encoder options.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public NotInheritable Class PngEncoderOptions _Inherits EncoderOptions
```
 
```csharp
public sealed class PngEncoderOptions : EncoderOptions
```
 
## Remarks
  
The only PNG-related option which is available is whether to make it interlaced.
 
[MediaFormat](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_EncoderOptions_MediaFormat.htm.md) property of this class always returns value that equals to [PngFormat](https://www.graphicsmill.com/docs/gm5/F_Aurigma_GraphicsMill_Codecs_FormatManager_PngFormat.htm.md) static field of the [FormatManager](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_FormatManager.htm.md) class. . [Left](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_EncoderOptions_Left.htm.md) and [Top](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_EncoderOptions_Top.htm.md) are meaningless for PNG and always set to 0.
 
## Examples
  
The code below converts the JPEG file into the PNG. It also demonstrates how to change PNG encoder settings.
 
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

bitmap.Save("C:\Mountain.png", _
    New Aurigma.GraphicsMill.Codecs.PngEncoderOptions(True))

bitmap.Dispose()
```
 
```csharp
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.Save(@"C:\Mountain.png", 
        new Aurigma.GraphicsMill.Codecs.PngEncoderOptions(true));
}
```
 
This code sample converts the image into the indexed bitmap with 32 palette entries. After that it saves this bitmap into the PNG file.
 
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

bitmap.ColorManagement.PaletteEntryCount = 32
bitmap.ColorManagement.ConvertToIndexed(8, Aurigma.GraphicsMill.ColorPaletteType.Adaptive, _
    Nothing)

bitmap.Save("C:\Mountain.png", _
    New Aurigma.GraphicsMill.Codecs.PngEncoderOptions(True))
```
 
```csharp
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.ColorManagement.PaletteEntryCount = 32;
    bitmap.ColorManagement.ConvertToIndexed(8, Aurigma.GraphicsMill.ColorPaletteType.Adaptive, 
        null);

    bitmap.Save(@"C:\Mountain.png", 
        new Aurigma.GraphicsMill.Codecs.PngEncoderOptions(true));
}
```
 
## Inheritance Hierarchy
  
- [System.Object](http://msdn2.microsoft.com/en-us/e5kfa45b)
    - [Aurigma.GraphicsMill.Codecs.EncoderOptions](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_EncoderOptions.htm.md)
        - Aurigma.GraphicsMill.Codecs.PngEncoderOptions
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are not safe for multi-threaded operations.
 
## Object Model

[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_200.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_PngEncoderOptions.htm.md)
![](https://www.graphicsmill.com/docs/gm5/ObjectModel1.png)[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_19.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_Frame.htm.md)
  
## See Also

### Reference

- [PngEncoderOptions Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_PngEncoderOptions.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
