Method

VipsImageflatten

Declaration [src]

int
vips_flatten (
  VipsImage* in,
  VipsImage** out,
  ...
)

Description [src]

Optional arguments:

  • background: VipsArrayDouble colour for new pixels
  • max_alpha: %gdouble, maximum value for alpha

Take the last band of in as an alpha and use it to blend the remaining channels with background.

The alpha channel is 0 - max_alpha, where max_alpha means 100% image and 0 means 100% background. background defaults to zero (black).

max_alpha has the default value 255, or 65535 for images tagged as

VIPS_INTERPRETATION_RGB16 or

VIPS_INTERPRETATION_GREY16.

Useful for flattening PNG images to RGB.

Non-complex images only.

See also: vips_premultiply(), vips_pngload().

This method is not directly available to language bindings.

Parameters

out

Type: VipsImage

Output image.

The argument will be set by the function.
The caller of the method takes ownership of the returned data, and is responsible for freeing it.
...

Type: 

NULL-terminated list of optional named arguments.

Return value

Type: int

0 on success, -1 on error.