- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Aurigma.GraphicsMill Namespace
- Aurigma.GraphicsMill.AjaxControls Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace
- Aurigma.GraphicsMill.Codecs Namespace
- AdobeResourceBlock Class
- AdobeResourceDictionary Class
- AdvancedPsdFrame Class
- AdvancedPsdReader Class
- AdvancedPsdTextFrame Class
- AsfIndexer Class
- AviAlphaTransition Class
- AviAudioManager Class
- AviCompressor Class
- AviCustomTransition Class
- AviDrawTransitionEventArgs Class
- AviDrawTransitionEventHandler Delegate
- AviDrawWatermarkEventArgs Class
- AviDrawWatermarkEventHandler Delegate
- AviEncoderOptions Class
- AviFrame Class
- AviReader Class
- AviStripesTransition Class
- AviStripesTransitionMode Enumeration
- AviTimerStyle Enumeration
- AviTransition Class
- AviWatermark Class
- AviWriter Class
- BmpEncoderOptions Class
- BmpFrame Class
- BmpReader Class
- BmpWriter Class
- CompressionType Enumeration
- CustomEncoderOptions Class
- CustomFormatReader Class
- CustomFormatReader.LoadingMode Enumeration
- CustomFormatWriter Class
- CustomFrame Class
- DisposalMethod Enumeration
- DSEncoderOptions Class
- DSFrame Class
- DSPreLoadedFrame Class
- DSReader Class
- EncoderOptions Class
- ExifDictionary Class
- ExifItemInfo Structure
- FormatManager Class
- FormatReader Class
- FormatWriter Class
- Frame Class
- GifEncoderOptions Class
- GifFrame Class
- GifReader Class
- GifWriter Class
- ID3LyricsContentType Enumeration
- ID3LyricsTimestampFormat Enumeration
- ID3SynchronisedLyrics Class
- IEncoderOptions Interface
- IFormatInfo Interface
- IFormatReader Interface
- IFormatWriter Interface
- IFrame Interface
- IFrameEnumerator Interface
- IMediaProcessorMetadataReadSupport Interface
- IMetadataReadSupport Interface
- IMetadataWriteSupport Interface
- IptcDictionary Class
- ITimeReader Interface
- ITimeWriter Interface
- IXmpDictionary Interface
- Jpeg2kEncoderOptions Class
- Jpeg2kFrame Class
- Jpeg2kProgressionOrder Enumeration
- Jpeg2kReader Class
- Jpeg2kWriter Class
- JpegAlignToSampleSizeMode Enumeration
- JpegEncoderOptions Class
- JpegFrame Class
- JpegMarkerException Class
- JpegReader Class
- JpegWriter Class
- LosslessJpegTransform Class
- MediaCorruptedException Class
- MediaFormatManager Class
- MediaProcessorMetadataDictionary Class
- MediaProviderException Class
- MediaUnsupportedException Class
- MetadataDictionary Class
- MetadataEnumerator Class
- MultiFrameException Class
- PcxEncoderOptions Class
- PcxFrame Class
- PcxReader Class
- PdfEncoderOptions Class
- PdfFrame Class
- PdfWriter Class
- PngEncoderOptions Class
- PngFrame Class
- PngReader Class
- PngWriter Class
- PreLoadedFrame Class
- PsdEncoderOptions Class
- PsdFrame Class
- PsdFrameType Enumeration
- PsdReader Class
- PsdTextJustification Enumeration
- QTEncoderOptions Class
- QTFrame Class
- QTReader Class
- SwfEncoderOptions Class
- SwfFrame Class
- SwfWriter Class
- TiffChannelType Enumeration
- TiffEncoderOptions Class
- TiffExtraChannel Class
- TiffExtraChannelCollection Class
- TiffFrame Class
- TiffReader Class
- TiffWriter Class
- WbmpEncoderOptions Class
- WbmpFrame Class
- WbmpReader Class
- WbmpWriter Class
- WMEncoderOptions Class
- WMFrame Class
- WMPreLoadedFrame Class
- WMReader Class
- XmpArrayNode Class
- XmpData Class
- XmpDictionaryNode Class
- XmpLocalizedTextItemNode Class
- XmpLocalizedTextNode Class
- XmpNamespace Class
- XmpNode Class
- XmpNodeType Enumeration
- XmpStructNode Class
- XmpTagNames Class
- XmpValueNode Class
- Aurigma.GraphicsMill.Drawing Namespace
- Aurigma.GraphicsMill.Licensing Namespace
- Aurigma.GraphicsMill.Transforms Namespace
- Aurigma.GraphicsMill.WebControls Namespace
- Aurigma.GraphicsMill.WinControls Namespace
- GraphicsMill Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace (Client Class Library)
- Samples
- Licensing
- Copyright Notices
JpegEncoderOptions Class
This class holds possible JPEG format encoder options.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
Public NotInheritable Class JpegEncoderOptions _
Inherits EncoderOptions
public sealed class JpegEncoderOptions : EncoderOptions
Remarks
The main JPEG encoder setting is a quality/file size ratio. It is specified with Quality property. This property accepts values in range [0, 100] where 0 means the lowest quality (but smallest file size) and 100 means the highest quality (but largest file size).
Besides of this you can specify is JPEG should be progressive (using IsProgressive). It allows the browsers to display the JPEG file while it is being downloaded (displaying more and more details upon new file portions download). Unfortunately this feature is not supported with Internet Explorer browser.
Another compression setting can be changed via ChromaSubsamplingEnabled property. Chroma subsampling is one of the compression methods used in JPEG. It is based on the specific of the human vision and allows to reduce size of the result file by storing color information at lower resolution than luminance information. In most cases this tradeoff will not be noticeable to the human. But sometimes such information loss may be significant (e.g. for some classes of image processing algorithms) and chroma subsampling should be turned off. Chroma subsampling is enabled by default.
Also you can provide meta-information for encoding. Use AdobeResources, Exif and Iptc properties to specify corresponding metadata objects.
MediaFormat property of this class always returns value that equals to JpegFormat static field of the FormatManager class. Left and Top are meaningless for JPEG and always set to 0.
Examples
This code sample demonstrates how to save the JPEG file with non-default encoder settings. Here we set low quality and make JPEG to be progressive (good for fast delivery via Web):
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")
bitmap.Save("C:\Mountain2.jpg", _
New Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(50, True))
bitmap.Dispose()
using (Aurigma.GraphicsMill.Bitmap bitmap =
new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
bitmap.Save(@"C:\Mountain2.jpg",
new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(50, true));
}
JPEG files can store EXIF and IPTC data blocks. Graphics Mill for .NET allows you extracting this data from the JPEG file and save it into another JPEG file (as well as into the other file format which supports EXIF and IPTC). This code sample demonstrates how to add the EXIF and IPTC data to the file:
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg")
Dim encoderOptions As New Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(50, True)
'EXIF
Dim exif As New Aurigma.GraphicsMill.Codecs.ExifDictionary
exif(Aurigma.GraphicsMill.Codecs.ExifDictionary.Software) = "Aurigma Graphics Mill"
encoderOptions.Exif = exif
'IPTC
Dim iptc As New Aurigma.GraphicsMill.Codecs.IptcDictionary
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Category) = "Nature"
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice) = "Aurigma Inc."
iptc(Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword) = "mountain"
encoderOptions.Iptc = iptc
'Adobe resource blocks
Dim adobeResources As New Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary
'Create new adobe image resource block with the required metadata
Dim arBlock As New Aurigma.GraphicsMill.Codecs.AdobeResourceBlock("Copyright", New Byte() {1})
'Set this block to the item with 0x040A ID (copyright flag)
adobeResources.Item(&H40A) = arBlock
encoderOptions.AdobeResources = adobeResources
'XMP
Dim xmp As New Aurigma.GraphicsMill.Codecs.XmpData()
'Create a node with the required metadata
Dim node As New Aurigma.GraphicsMill.Codecs.XmpValueNode( _
Aurigma.GraphicsMill.Codecs.XmpNodeType.SimpleProperty, _
"John Doe", _
Aurigma.GraphicsMill.Codecs.XmpTagNames.DCCreator)
xmp.AddNode(node)
encoderOptions.Xmp = xmp.Save()
bitmap.Save("C:\Mountain2.jpg", encoderOptions)
bitmap.Dispose()
using (Aurigma.GraphicsMill.Bitmap bitmap =
new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg"))
{
Aurigma.GraphicsMill.Codecs.JpegEncoderOptions encoderOptions =
new Aurigma.GraphicsMill.Codecs.JpegEncoderOptions(50, true);
//EXIF
Aurigma.GraphicsMill.Codecs.ExifDictionary exif =
new Aurigma.GraphicsMill.Codecs.ExifDictionary();
exif[Aurigma.GraphicsMill.Codecs.ExifDictionary.Software] = "Aurigma Graphics Mill";
encoderOptions.Exif = exif;
//IPTC
Aurigma.GraphicsMill.Codecs.IptcDictionary iptc =
new Aurigma.GraphicsMill.Codecs.IptcDictionary();
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Category] = "Nature";
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.CopyrightNotice] = "Aurigma Inc.";
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword] = "mountain";
encoderOptions.Iptc = iptc;
//Adobe resource blocks
Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary adobeResources =
new Aurigma.GraphicsMill.Codecs.AdobeResourceDictionary();
//Create new adobe image resource block with the required metadata
Aurigma.GraphicsMill.Codecs.AdobeResourceBlock arBlock = new
Aurigma.GraphicsMill.Codecs.AdobeResourceBlock("Copyright", new byte[] { 1 });
//Set this block to the item with 0x040A ID (copyright flag)
adobeResources[0x040A] = arBlock;
encoderOptions.AdobeResources = adobeResources;
//XMP
Aurigma.GraphicsMill.Codecs.XmpData xmp = new Aurigma.GraphicsMill.Codecs.XmpData();
//Create a node with the required metadata
Aurigma.GraphicsMill.Codecs.XmpValueNode node = new
Aurigma.GraphicsMill.Codecs.XmpValueNode(
Aurigma.GraphicsMill.Codecs.XmpNodeType.SimpleProperty,
"John Doe",
Aurigma.GraphicsMill.Codecs.XmpTagNames.DCCreator);
xmp.AddNode(node);
encoderOptions.Xmp = xmp.Save();
bitmap.Save(@"C:\Mountain2.jpg", encoderOptions);
}
Inheritance Hierarchy
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








