Method

VipsImagejp2ksave

Declaration [src]

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

Description [src]

Optional arguments:

  • Q: %gint, quality factor
  • lossless: %gboolean, enables lossless compression
  • tile_width: %gint for tile size
  • tile_height: %gint for tile size
  • subsample_mode: VipsForeignSubsample, chroma subsampling mode

Write a VIPS image to a file in JPEG2000 format. The saver supports 8, 16 and 32-bit int pixel values, signed and unsigned. It supports greyscale, RGB, CMYK and multispectral images.

Use Q to set the compression quality factor. The default value produces file with approximately the same size as regular JPEG Q 75.

Set lossless to enable lossless compresion.

Use tile_width and tile_height to set the tile size. The default is 512.

Chroma subsampling is normally disabled for compatibility. Set subsample_mode to auto to enable chroma subsample for Q < 90. Subsample mode uses YCC rather than RGB colourspace, and many jpeg2000 decoders do not support this.

This operation always writes a pyramid.

See also: vips_image_write_to_file(), vips_jp2kload().

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.