This class enables you to write JPEG2000 images.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class Jpeg2kWriter _ Inherits FormatWriter
public sealed class Jpeg2kWriter : FormatWriter
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:
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.
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:
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()
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); } } }
Member Name | Description |
---|---|
Format8bppGrayScale | 8 bits per pixel. Grayscale. 8 bits are used for luminosity level. |
Format16bppGrayScale | 16 bits per pixel. Grayscale. All 16 bits are used for luminosity level (extended pixel format). |
Format16bppAGrayScale | 16 bits per pixel. Grayscale with alpha channel. 8 bits are used for alpha channel and other 8 bits are used for luminosity level. |
Format32bppAGrayScale | 32 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). |
Format24bppRgb | 24 bits per pixel. RGB. 8 bits each are used for the red, green, and blue components. |
Format32bppArgb | 32 bits per pixel. RGB with alpha channel. 8 bits each are used for the alpha, red, green, and blue components. |
Format48bppRgb | 48 bits per pixel. RGB. 16 bits each are used for the red, green, and blue components (extended pixel format). |
Format64bppArgb | 64 bits per pixel. RGB with alpha channel. 16 bits each are used for the alpha, red, green, and blue components (extended pixel format). |