JpegOptions Class
The jpeg file format create options.
Inheritance Hierarchy
SystemObject
  Aspose.PSDDisposableObject
    Aspose.PSDImageOptionsBase
      Aspose.PSD.ImageOptionsJpegOptions

Namespace: Aspose.PSD.ImageOptions
Assembly: Aspose.PSD (in Aspose.PSD.dll) Version: 20.5
Syntax
public class JpegOptions : ImageOptionsBase

The JpegOptions type exposes the following members.

Constructors
  NameDescription
Public methodJpegOptions
Initializes a new instance of the JpegOptions class.
Public methodJpegOptions(JpegOptions)
Initializes a new instance of the JpegOptions class.
Properties
  NameDescription
Public propertyBitsPerChannel
Gets or sets bits per channel for lossless jpeg image. Now we support from 2 to 8 bits per channel.
Public propertyBufferSizeHint
Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
(Inherited from ImageOptionsBase.)
Public propertyCmykColorProfile
The destination CMYK color profile for CMYK jpeg images. Use for saving images. Must be in pair with RGBColorProfile for correct color conversion.
Public propertyColorType
Gets or sets the color type for jpeg image.
Public propertyComment
Gets or sets the jpeg file comment.
Public propertyCompressionType
Gets or sets the compression type.
Public propertyDefaultMemoryAllocationLimit Obsolete.
Gets or sets the default memory allocation limit.
Public propertyDisposed
Gets a value indicating whether this instance is disposed.
(Inherited from DisposableObject.)
Public propertyExifData
Get or set exif data container
Public propertyHorizontalSampling
Gets or sets the horizontal subsamplings for each component.
Public propertyJfif
Gets or sets the jfif.
Public propertyJpegLsAllowedLossyError
Gets or sets the JPEG-LS difference bound for near-lossless coding (NEAR parameter from the JPEG-LS specification).
Public propertyJpegLsInterleaveMode
Gets or sets the JPEG-LS interleave mode.
Public propertyJpegLsPreset
Gets or sets the JPEG-LS preset parameters.
Public propertyMultiPageOptions
The multipage options
(Inherited from ImageOptionsBase.)
Public propertyPalette
Gets or sets the color palette.
(Inherited from ImageOptionsBase.)
Public propertyPreblendAlphaIfPresent
Gets or sets a value indicating whether red, green and blue components should be mixed with a background color, if alpha channel is present.
Public propertyProgressEventHandler
Gets or sets the progress event handler.
(Inherited from ImageOptionsBase.)
Public propertyQuality
Gets or sets image quality.
Public propertyRdOptSettings
Gets or sets the RD optimizer settings.
Public propertyResolutionSettings
Gets or sets the resolution settings.
(Inherited from ImageOptionsBase.)
Public propertyResolutionUnit
Gets or sets the resolution unit.
Public propertyRgbColorProfile
The destination RGB color profile for CMYK jpeg images. Use for saving images. Must be in pair with CMYKColorProfile for correct color conversion.
Public propertySampleRoundingMode
Gets or sets the sample rounding mode to fit an 8-bit value to an n-bit value. BitsPerChannel
Public propertyScaledQuality
The scaled quality.
Public propertySource
Gets or sets the source to create image in.
(Inherited from ImageOptionsBase.)
Public propertyVectorRasterizationOptions
Gets or sets the vector rasterization options.
(Inherited from ImageOptionsBase.)
Public propertyVerticalSampling
Gets or sets the vertical subsamplings for each component.
Public propertyXmpData
Gets or sets the XMP metadata container.
(Overrides ImageOptionsBaseXmpData.)
Methods
  NameDescription
Public methodClone
Clones this instance.
(Inherited from ImageOptionsBase.)
Public methodDispose
Disposes the current instance.
(Inherited from DisposableObject.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Inherited from DisposableObject.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodReleaseManagedResources
Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.
(Inherited from ImageOptionsBase.)
Protected methodReleaseUnmanagedResources
Releases the unmanaged resources. Make sure no managed resources are released here, since they may have been already released.
(Inherited from DisposableObject.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodVerifyNotDisposed
Verifies that the current instance is not disposed.
(Inherited from DisposableObject.)
Fields
  NameDescription
Protected fieldxmpData
XMP metadata of image.
(Inherited from ImageOptionsBase.)
Examples
This example demonstrates the use of Aspose.PSD for .Net API to convert Images to Jpeg format. To achieve this goal this example loads an existing image and then converts it to Jpeg file format.
[C#]

//Creates an instance of image class and initialize it with an existing file through File path
using (Aspose.PSD.Image image = Aspose.PSD.Image.Load(@"C:\temp\image.psd"))
{
    //Create an instance of PsdOptions class
    Aspose.PSD.ImageOptions.JpegOptions jpegOptions = new Aspose.PSD.ImageOptions.JpegOptions();

    //Set the quality to 50% to lower size of output image.
    jpegOptions.Quality = 50;

    //Set the exif comments.
    jpegOptions.ExifData = new Aspose.PSD.Exif.JpegExifData();
    jpegOptions.ExifData.Copyright = "This file was created using some custom engine. All rights reserved.";

    //Save the image to disk location with supplied JpegOptions settings
    image.Save(@"C:\temp\output.jpeg", jpegOptions);
}
Examples
This example demonstrates the use of System.IO.Stream to Create a new Image file
[C#]

//Creates an instance of PsdOptions and set its various properties
Aspose.PSD.ImageOptions.PsdOptions psdOptions = new Aspose.PSD.ImageOptions.PsdOptions();

//Create an instance of System.IO.Stream
System.IO.Stream stream = new System.IO.FileStream(@"C:\temp\sample.psd", System.IO.FileMode.Create);

//Define the source property for the instance of PsdOptions
//Second boolean parameter determins if the Stream is disposed once get out of scope
psdOptions.Source = new Aspose.PSD.Sources.StreamSource(stream, true);

//Creates an instance of Image and call Create method with PsdOptions as parameter to initialize the Image object   
using (Aspose.PSD.Image image = Aspose.PSD.Image.Create(psdOptions, 500, 500))
{
    //do some image processing
}
Examples
This example demonstrates the use of different classes from SaveOptions Namespace for export purposes. An image of type Psd is loaded into an instance of Image and then exported out to several formats.
[C#]

//Load an existing image in an instance of Image class
using (Aspose.PSD.Image image = Aspose.PSD.Image.Load(@"C:\temp\image.psd"))
{
    //Export to BMP file format using the default options
    image.Save(@"C:\temp\output.bmp", new Aspose.PSD.ImageOptions.BmpOptions());

    //Export to JPEG file format using the default options
    image.Save(@"C:\temp\output.jpeg", new Aspose.PSD.ImageOptions.JpegOptions());

    //Export to JPEG 2000 file format using the default options
    image.Save(@"C:\temp\output.jp2", new Aspose.PSD.ImageOptions.Jpeg2000Options());

    //Export to PNG file format using the default options
    image.Save(@"C:\temp\output.png", new Aspose.PSD.ImageOptions.PngOptions());

    //Export to TIFF file format using the default options
    image.Save(@"c:\temp\output.tiff", new Aspose.PSD.ImageOptions.TiffOptions(Aspose.PSD.FileFormats.Tiff.Enums.TiffExpectedFormat.Default));
}
See Also