Skip to contents

Saves an image stored as an array to a path or file object.

Usage

image_array_save(
  x,
  path,
  data_format = NULL,
  file_format = NULL,
  scale = TRUE,
  ...
)

Arguments

x

An array.

path

Path or file object.

data_format

Image data format, either "channels_first" or "channels_last".

file_format

Optional file format override. If omitted, the format to use is determined from the filename extension. If a file object was used instead of a filename, this parameter should always be used.

scale

Whether to rescale image values to be within [0, 255].

...

Additional keyword arguments passed to PIL.Image.save().

Value

Called primarily for side effects. The input x is returned, invisibly, to enable usage with the pipe.