This documentation is for the old version. Go to the latest Graphics Mill docs

Jpeg2kWriter Class

This class enables you to write JPEG2000 images.

Namespace: Aurigma.GraphicsMill.Codecs
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public NotInheritable Class Jpeg2kWriter _
	Inherits FormatWriter
C#
public sealed class Jpeg2kWriter : FormatWriter

Remarks

JPEG2000 is an image format which implements wavelet-based compression algorithm. This algorithm provides high compression ratio with better quality than JPEG. This compression is also lossy, however JPEG2000 artifacts are looking visually better comparing to JPEG.

Graphics Mill for .NET can save bitmaps to JPEG2000 format in two color spaces:

  • RGB;
  • Grayscale;

These bitmaps can be both extended (16 bit per channel) and non-extended (8 bit per channel). Also, these bitmaps may contain an alpha channel.

Examples

You can use Jpeg2kWriter class instead of the Save(String, IEncoderOptions) method of the Bitmap. In particular it enables you to save the image asynchronously.

The Jpeg2kWriter class usage is demonstrated below:

Visual Basic
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")

Dim writer As New Aurigma.GraphicsMill.Codecs.Jpeg2kWriter("C:\Mountain2.jp2")

Dim frame As New Aurigma.GraphicsMill.Codecs.Jpeg2kFrame
frame.Rate = 0.1
frame.SetBitmap(bitmap)

bitmap.Dispose()

writer.AddFrame(frame)

frame.Dispose()

writer.Dispose()
C#
using (Aurigma.GraphicsMill.Bitmap bitmap = 
            new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
    using (Aurigma.GraphicsMill.Codecs.Jpeg2kWriter writer = 
        new Aurigma.GraphicsMill.Codecs.Jpeg2kWriter())
    {
        writer.Open(@"C:\Mountain2.jp2");

        using (Aurigma.GraphicsMill.Codecs.Jpeg2kFrame frame = 
                    new Aurigma.GraphicsMill.Codecs.Jpeg2kFrame())
        {
            frame.Rate = 0.1f;
            frame.SetBitmap(bitmap);

            writer.AddFrame(frame);
        }
    }
}

Inheritance Hierarchy

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





Supported Pixel Formats

Member NameDescription
Format8bppGrayScale8 bits per pixel. Grayscale. 8 bits are used for luminosity level.
Format16bppGrayScale16 bits per pixel. Grayscale. All 16 bits are used for luminosity level (extended pixel format).
Format16bppAGrayScale16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level.
Format32bppAGrayScale32 bits per pixel. Grayscale with alpha channel. 16 bits are used for alpha channel and other 16 bits are used for luminosity level (extended pixel format).
Format24bppRgb24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components.
Format32bppArgb32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components.
Format48bppRgb48 bits per pixel. RGB. 16 bits each are used for the red, green, and blue components (extended pixel format).
Format64bppArgb64 bits per pixel. RGB with alpha channel. 16 bits each are used for the alpha, red, green, and blue components (extended pixel format).

See Also

Reference