---
title: "Jpeg2kEncoderOptions Class"
canonical: https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions.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/)

# Jpeg2kEncoderOptions Class
 
This class holds possible JPEG2000 format 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 Jpeg2kEncoderOptions _Inherits EncoderOptions
```
 
```csharp
public sealed class Jpeg2kEncoderOptions : EncoderOptions
```
 
## Remarks
  
JPEG2000 files can be compressed either with lossy or lossless compression algorithm. You can select it using the [Compression](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions_Compression.htm.md) property. When lossy compression ([WaveletLossy](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_CompressionType.htm.md)) is used, you can specify the compression ratio using the [Rate](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions_Rate.htm.md) property. It can accepts values from 0 to 1, and specifies the ratio between compressed and uncompressed bitmap. E.g. you compress 1MB bitmap and specify the [Rate](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions_Rate.htm.md) to 0.1. As a result, you will get 100KB JPEG2000 file.
 
Also you can specify additional JPEG2000 encoder settings, such as tile size ([TileWidth](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions_TileWidth.htm.md) and [TileHeight](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions_TileHeight.htm.md)), as well as a progression order ([ProgressionOrder](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions_ProgressionOrder.htm.md)).
 
[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 [Jpeg2kFormat](https://www.graphicsmill.com/docs/gm5/F_Aurigma_GraphicsMill_Codecs_FormatManager_Jpeg2kFormat.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 JPEG2000 and always set to 0.
 
## Examples
  
This code sample demonstrates how to save the JPEG2000 file with non-default encoder settings. Here we use high compression. The result file size will be only 10% from the original size:
 
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

bitmap.Save("C:\Mountain2.jp2", _
    New Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions(0.1))

bitmap.Dispose()
```
 
```csharp
using (Aurigma.GraphicsMill.Bitmap bitmap = 
           new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    bitmap.Save(@"C:\Mountain2.jp2", 
        new Aurigma.GraphicsMill.Codecs.Jpeg2kEncoderOptions(0.1f));
}
```
 
## 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.Jpeg2kEncoderOptions
 
## Thread Safety
 Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.
 
## Object Model

[![](https://www.graphicsmill.com/docs/gm5/Aurigma.GraphicsMill_ObjectModel_165.png)](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions.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

- [Jpeg2kEncoderOptions Members](https://www.graphicsmill.com/docs/gm5/AllMembers_T_Aurigma_GraphicsMill_Codecs_Jpeg2kEncoderOptions.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
