Method

VipsImageppmsave

Declaration [src]

int
vips_ppmsave (
  VipsImage* in,
  const char* filename,
  ...
)

Description [src]

Optional arguments:

  • format: VipsForeignPpmFormat, format to save in
  • ascii: %gboolean, save as ASCII rather than binary
  • bitdepth: %gint, bitdepth to save at

Write a VIPS image to a file as PPM. It can write 1, 8, 16 or 32 bit unsigned integer images, float images, colour or monochrome, stored as binary or ASCII. Integer images of more than 8 bits can only be stored in ASCII.

When writing float (PFM) images the scale factor is set from the “pfm-scale” metadata.

Set ascii to TRUE to write as human-readable ASCII. Normally data is written in binary.

Set bitdepth to 1 to write a one-bit image.

format defaults to the sub-type for this filename suffix.

See also: vips_image_write_to_file().

This method is not directly available to language bindings.

Parameters

filename const char*
 

File to write to.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
...
 

NULL-terminated list of optional named arguments.

Return value

Returns: int
 

0 on success, -1 on error.