# ImageSaveParams Class

> Class that defines parameters for saving an image to a graphics file.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ImageSaveParams
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/llms.txt

```java
class ImageSaveParams
```

**Namespace:** `com::datalogics::PDFL`

## Description

Class that defines parameters for saving an image to a graphics file. The parameters include the file type (such as PNG or JPG), compression, image quality, and gray scale.

**Referenced by:** [`Image`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Image.md), [`ImageCollection`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ImageCollection.md)

## Constructors

### ImageSaveParams

```java
com.datalogics.PDFL.ImageSaveParams.ImageSaveParams()
```

*constructor*

Default parameters for saving an image to a file.

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.ImageSaveParams.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.ImageSaveParams.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.ImageSaveParams.finalize()
```

*protected*

**Returns:** `void`

### getCompression

```java
CompressionCode com.datalogics.PDFL.ImageSaveParams.getCompression()
```

**Returns:** `CompressionCode`

The compression code currently set. The default is CompressionCode.Default.

Gets the type of compression to be used in saving the image to a file.

### getDisableAlphaChannelGeneration

```java
boolean com.datalogics.PDFL.ImageSaveParams.getDisableAlphaChannelGeneration()
```

**Returns:** `boolean`

true if alpha channel generation is disabled, false otherwise.

Gets whether alpha channel generation is disabled for the output image. When false, RGB image data with a Mask will be combined as RGBA + Alpha Channel output (32-bit). When true, the Mask is not combined and the output is RGB (24-bit). This is only valid for TIFF and PNG output formats.

### getHalftoneGrayImages

```java
boolean com.datalogics.PDFL.ImageSaveParams.getHalftoneGrayImages()
```

**Returns:** `boolean`

true if halftone conversion is enabled, false otherwise.

Gets whether grayscale images are converted to halftone. When true, converts 8bpc grayscale images to 1bpc (B/W) images using a 45 degree line screen set for 106lpi at 600dpi. Note this can only be set to true for an image of ColorSpace of DeviceGray.

### getJPEGQuality

```java
int com.datalogics.PDFL.ImageSaveParams.getJPEGQuality()
```

**Returns:** `int`

The JPEG quality value (0-100). The default is 0.

Gets the quality of a JPEG output image.

### getMonochromeThreshold

```java
short com.datalogics.PDFL.ImageSaveParams.getMonochromeThreshold()
```

**Returns:** `short`

The monochrome threshold value (0-255). The default is 128.

Gets the threshold for determining which bits are white or black for Monochrome output. Note: this is only valid for TIF Images using G3 or G4 compression and HalftoneGrayImages must be set to false.

### getRaiseExceptionIfNotUsableColor

```java
boolean com.datalogics.PDFL.ImageSaveParams.getRaiseExceptionIfNotUsableColor()
```

**Returns:** `boolean`

true if an exception will be raised for unsupported color formats, false otherwise.

Gets whether an exception is raised if the image color format is not natively supported. When true, an exception will be raised if the image being saved is not in a format this graphic form can save natively. When false, the image will be automatically converted into a form that can be saved natively (generally DeviceRGB using the sRGB profile).

### getReverseGray

```java
boolean com.datalogics.PDFL.ImageSaveParams.getReverseGray()
```

**Returns:** `boolean`

true if the grayscale output will be reversed, false otherwise.

Gets whether the GrayScale output is reversed. Note this is only valid for an image with a DeviceGray Colorspace.

### getTIFFBlackIsOne

```java
boolean com.datalogics.PDFL.ImageSaveParams.getTIFFBlackIsOne()
```

**Returns:** `boolean`

true if the TIFF image is photometrically reversed, false otherwise.

Gets whether a TIFF file is photometrically reversed. Note this is only valid for a 1-bit TIFF image with a DeviceGray Colorspace.

### getTIFFByteOrder

```java
TIFFByteOrder com.datalogics.PDFL.ImageSaveParams.getTIFFByteOrder()
```

**Returns:** `TIFFByteOrder`

The current TIFF byte order setting.

Gets the byte order used within the TIFF file. This is only valid for TIFF output.

### getTIFFCMYKAlpha

```java
boolean com.datalogics.PDFL.ImageSaveParams.getTIFFCMYKAlpha()
```

**Returns:** `boolean`

true if CMYK + Alpha channel TIFF output is enabled, false otherwise.

Gets whether CMYK image data is combined with the Soft Mask in TIFF output. Note: This is only valid for CMYK image data which has a Soft Mask; the output will be 40-bit.

### getWriteSeparationColorsToTIFF

```java
boolean com.datalogics.PDFL.ImageSaveParams.getWriteSeparationColorsToTIFF()
```

**Returns:** `boolean`

true if separation colors are written to TIFF, false if converted to sRGB.

Gets whether separation colors are written to TIFF using the Photoshop tag. When false, separation colors will be converted to their alternate color space and rendered as RGB. When true, separation colors are output using the TIFF Photoshop tag.

### setCompression

```java
void com.datalogics.PDFL.ImageSaveParams.setCompression(CompressionCode compression)
```

**Parameters**

- `compression` (`CompressionCode`): The compression code to use.

**Returns:** `void`

Sets the type of compression to be used in saving the image to a file. Note this is only valid for TIF images.

### setDisableAlphaChannelGeneration

```java
void com.datalogics.PDFL.ImageSaveParams.setDisableAlphaChannelGeneration(boolean disableAlphaChannelGeneration)
```

**Parameters**

- `disableAlphaChannelGeneration` (`boolean`): true to disable alpha channel generation.

**Returns:** `void`

Sets whether alpha channel generation is disabled for the output image. This is only valid for output image types of TIF and PNG. The default value is false.

### setHalftoneGrayImages

```java
void com.datalogics.PDFL.ImageSaveParams.setHalftoneGrayImages(boolean halftoneGray)
```

**Parameters**

- `halftoneGray` (`boolean`): true to enable halftone conversion.

**Returns:** `void`

Sets whether grayscale images are converted to halftone. Note this can only be set to true for an image of ColorSpace of DeviceGray. The default value is false.

### setJPEGQuality

```java
void com.datalogics.PDFL.ImageSaveParams.setJPEGQuality(int jpegQuality)
```

**Parameters**

- `jpegQuality` (`int`): The JPEG quality value (0-100).

**Returns:** `void`

Sets the quality of a JPEG output image. Note this is only valid for JPEG images.

### setMonochromeThreshold

```java
void com.datalogics.PDFL.ImageSaveParams.setMonochromeThreshold(short monochromeThreshold)
```

**Parameters**

- `monochromeThreshold` (`short`): The monochrome threshold value (0-255).

**Returns:** `void`

Sets the threshold for determining which bits are white or black for Monochrome output. Note: this is only valid for TIF Images using G3 or G4 compression and HalftoneGrayImages must be set to false.

### setRaiseExceptionIfNotUsableColor

```java
void com.datalogics.PDFL.ImageSaveParams.setRaiseExceptionIfNotUsableColor(boolean RaiseExceptionIfNotUsableColor)
```

**Parameters**

- `RaiseExceptionIfNotUsableColor` (`boolean`): true to raise an exception, false to auto-convert.

**Returns:** `void`

Sets whether an exception is raised if the image color format is not natively supported. The default value is false.

### setReverseGray

```java
void com.datalogics.PDFL.ImageSaveParams.setReverseGray(boolean reversegray)
```

**Parameters**

- `reversegray` (`boolean`): true to reverse the grayscale output.

**Returns:** `void`

Sets whether the GrayScale output is reversed. This is only valid for images using the DeviceGray ColorSpace. The default value is false.

### setTIFFBlackIsOne

```java
void com.datalogics.PDFL.ImageSaveParams.setTIFFBlackIsOne(boolean blackIsOne)
```

**Parameters**

- `blackIsOne` (`boolean`): true to photometrically reverse the TIFF image.

**Returns:** `void`

Sets whether a TIFF file is photometrically reversed. This is only valid for an output image of type TIF. The default value is false.

### setTIFFByteOrder

```java
void com.datalogics.PDFL.ImageSaveParams.setTIFFByteOrder(TIFFByteOrder tiffByteOrder)
```

**Parameters**

- `tiffByteOrder` (`TIFFByteOrder`): The byte order to use for the TIFF file.

**Returns:** `void`

Sets the byte order used within the TIFF file. This is only valid for TIFF output.

### setTIFFCMYKAlpha

```java
void com.datalogics.PDFL.ImageSaveParams.setTIFFCMYKAlpha(boolean cmykAlpha)
```

**Parameters**

- `cmykAlpha` (`boolean`): true to combine CMYK data with the Soft Mask as 40-bit TIFF output.

**Returns:** `void`

Sets whether CMYK image data is combined with the Soft Mask in TIFF output. This is only valid for an output image of type TIF. The default value is false.

### setWriteSeparationColorsToTIFF

```java
void com.datalogics.PDFL.ImageSaveParams.setWriteSeparationColorsToTIFF(boolean WriteSeparationColorsToTIFF)
```

**Parameters**

- `WriteSeparationColorsToTIFF` (`boolean`): true to write separation colors to TIFF, false to convert to sRGB.

**Returns:** `void`

Sets whether separation colors are written to TIFF using the Photoshop tag. The default value is false.
