# ImageSaveParams Class

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

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ImageSaveParams
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class ImageSaveParams
```

**Namespace:** `datalogics_interface`

## 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.

**Uses types:** [`CompressionCode`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/CompressionCode.md), [`TIFFByteOrder`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/TIFFByteOrder.md)

## Constructors

### ImageSaveParams

```cpp
datalogics_interface::ImageSaveParams::ImageSaveParams()
```

*constructor*

Default constructor. All options are initialised to defaults.

### ImageSaveParams

```cpp
datalogics_interface::ImageSaveParams::ImageSaveParams(ImageSaveParams &&) noexcept
```

*constructor*

**Parameters**

- (unnamed) ([`ImageSaveParams &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ImageSaveParams.md))

### ~ImageSaveParams

```cpp
datalogics_interface::ImageSaveParams::~ImageSaveParams()
```

*destructor*

## Methods

### get_compression

```cpp
CompressionCode datalogics_interface::ImageSaveParams::get_compression() const
```

**Returns:** [`CompressionCode`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/CompressionCode.md)

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.

### get_disable_alpha_channel_generation

```cpp
bool datalogics_interface::ImageSaveParams::get_disable_alpha_channel_generation() const
```

**Returns:** `bool`

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.

### get_halftone_gray_images

```cpp
bool datalogics_interface::ImageSaveParams::get_halftone_gray_images() const
```

**Returns:** `bool`

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.

### get_jpeg_quality

```cpp
int datalogics_interface::ImageSaveParams::get_jpeg_quality() const
```

**Returns:** `int`

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

Gets the quality of a JPEG output image.

### get_monochrome_threshold

```cpp
unsigned char datalogics_interface::ImageSaveParams::get_monochrome_threshold() const
```

**Returns:** `unsigned char`

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.

### get_raise_exception_if_not_usable_color

```cpp
bool datalogics_interface::ImageSaveParams::get_raise_exception_if_not_usable_color() const
```

**Returns:** `bool`

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).

### get_reverse_gray

```cpp
bool datalogics_interface::ImageSaveParams::get_reverse_gray() const
```

**Returns:** `bool`

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.

### get_tiff_black_is_one

```cpp
bool datalogics_interface::ImageSaveParams::get_tiff_black_is_one() const
```

**Returns:** `bool`

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.

### get_tiff_byte_order

```cpp
TIFFByteOrder datalogics_interface::ImageSaveParams::get_tiff_byte_order() const
```

**Returns:** [`TIFFByteOrder`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/TIFFByteOrder.md)

The current TIFF byte order setting.

Gets the byte order used within the TIFF file.

This is only valid for TIFF output.

### get_tiff_cmyk_alpha

```cpp
bool datalogics_interface::ImageSaveParams::get_tiff_cmyk_alpha() const
```

**Returns:** `bool`

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.

### get_write_separation_colors_to_tiff

```cpp
bool datalogics_interface::ImageSaveParams::get_write_separation_colors_to_tiff() const
```

**Returns:** `bool`

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.

### operator=

```cpp
ImageSaveParams & datalogics_interface::ImageSaveParams::operator=(ImageSaveParams &&) noexcept
```

**Parameters**

- (unnamed) ([`ImageSaveParams &&`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ImageSaveParams.md))

**Returns:** [`ImageSaveParams &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ImageSaveParams.md)

### set_compression

```cpp
void datalogics_interface::ImageSaveParams::set_compression(CompressionCode code)
```

**Parameters**

- `code` ([`CompressionCode`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/CompressionCode.md))

**Returns:** `void`

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.

### set_disable_alpha_channel_generation

```cpp
void datalogics_interface::ImageSaveParams::set_disable_alpha_channel_generation(bool disable)
```

**Parameters**

- `disable` (`bool`)

**Returns:** `void`

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.

### set_halftone_gray_images

```cpp
void datalogics_interface::ImageSaveParams::set_halftone_gray_images(bool halftone)
```

**Parameters**

- `halftone` (`bool`)

**Returns:** `void`

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.

### set_jpeg_quality

```cpp
void datalogics_interface::ImageSaveParams::set_jpeg_quality(int quality)
```

**Parameters**

- `quality` (`int`)

**Returns:** `void`

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

Gets the quality of a JPEG output image.

### set_monochrome_threshold

```cpp
void datalogics_interface::ImageSaveParams::set_monochrome_threshold(unsigned char threshold)
```

**Parameters**

- `threshold` (`unsigned char`)

**Returns:** `void`

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.

### set_raise_exception_if_not_usable_color

```cpp
void datalogics_interface::ImageSaveParams::set_raise_exception_if_not_usable_color(bool raise)
```

**Parameters**

- `raise` (`bool`)

**Returns:** `void`

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).

### set_reverse_gray

```cpp
void datalogics_interface::ImageSaveParams::set_reverse_gray(bool reverse)
```

**Parameters**

- `reverse` (`bool`)

**Returns:** `void`

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.

### set_tiff_black_is_one

```cpp
void datalogics_interface::ImageSaveParams::set_tiff_black_is_one(bool black_is_one)
```

**Parameters**

- `black_is_one` (`bool`)

**Returns:** `void`

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.

### set_tiff_byte_order

```cpp
void datalogics_interface::ImageSaveParams::set_tiff_byte_order(TIFFByteOrder order)
```

**Parameters**

- `order` ([`TIFFByteOrder`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/enum/TIFFByteOrder.md))

**Returns:** `void`

The current TIFF byte order setting.

Gets the byte order used within the TIFF file.

This is only valid for TIFF output.

### set_tiff_cmyk_alpha

```cpp
void datalogics_interface::ImageSaveParams::set_tiff_cmyk_alpha(bool cmyk_alpha)
```

**Parameters**

- `cmyk_alpha` (`bool`)

**Returns:** `void`

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.

### set_write_separation_colors_to_tiff

```cpp
void datalogics_interface::ImageSaveParams::set_write_separation_colors_to_tiff(bool write)
```

**Parameters**

- `write` (`bool`)

**Returns:** `void`

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.
