Image.Options.Write (image v0.59.0)

View Source

Options and option validation for Image.write/3.

Summary

Types

Options for writing a gif file with Image.write/2.

Allowable compression types for heif images.

Options for writing a heif file with Image.write/2.

Options for writing an image to a file with Image.write/2.

Options for writing a jpeg file with Image.write/2.

Options for writing a png file with Image.write/2.

Options for writing an image stream

Options for writing a tiff file with Image.write/2.

Options for writing a webp file with Image.write/2.

Types

gif_write_option()

@type gif_write_option() :: {:interframe_maxerror, 0..32} | {:effort, 1..10}

Options for writing a gif file with Image.write/2.

heif_compression()

@type heif_compression() :: :hevc | :avc | :jpeg | :av1

Allowable compression types for heif images.

heif_write_option()

@type heif_write_option() ::
  {:compression, heif_compression()}
  | {:effort, 1..10}
  | {:minimize_file_size, boolean()}

Options for writing a heif file with Image.write/2.

image_write_options()

@type image_write_options() :: [
  {:quality, 1..100}
  | {:background, Image.pixel()}
  | stream_write_option()
  | jpeg_write_option()
  | png_write_option()
  | tiff_write_option()
  | webp_write_option()
  | heif_write_option()
  | gif_write_option()
]

Options for writing an image to a file with Image.write/2.

jpeg_write_option()

@type jpeg_write_option() ::
  {:strip_metadata, boolean()}
  | {:icc_profile, Path.t()}
  | {:minimize_file_size, boolean()}

Options for writing a jpeg file with Image.write/2.

png_write_option()

@type png_write_option() ::
  {:strip_metadata, boolean()}
  | {:icc_profile, Path.t()}
  | {:minimize_file_size, boolean()}
  | {:compression, 1..9}
  | {:effort, 1..10}

Options for writing a png file with Image.write/2.

stream_write_option()

@type stream_write_option() ::
  {:buffer_size, pos_integer() | :unbuffered} | {:suffix, String.t()}

Options for writing an image stream

tiff_write_option()

@type tiff_write_option() :: {:icc_profile, Path.t()} | {:pyramid, boolean()}

Options for writing a tiff file with Image.write/2.

webp_write_option()

@type webp_write_option() ::
  {:icc_profile, Path.t()}
  | {:strip_metadata, boolean()}
  | {:minimize_file_size, boolean()}
  | {:effort, 1..10}

Options for writing a webp file with Image.write/2.

Functions

validate_options(options, options)