### Method

# Vips Image jxlsave

#### Declaration [src]

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

#### Description [src]

Write a VIPS image to a file in JPEG-XL format. The image can be unsigned 8 or 16-bit integer, or float. Use `bitdepth` for fine control of the image bitdepth.

`tier` sets the overall decode speed the encoder will target. Minimum is 0 (highest quality), and maximum is 4 (lowest quality). Default is 0.

`distance` sets the target maximum encoding error. Minimum is 0 (highest quality), and maximum is 15 (lowest quality). Default is 1.0 (visually lossless).

As a convenience, you can also use `Q` to set `distance`. `Q` uses approximately the same scale as regular JPEG.

`bitdepth` sets the bitdepth to save at. It defaults to the full range of the image numeric type, but can be set lower. It has no effect on float images.

Set `lossless` to enable lossless compression.

Optional arguments

- `tier`: `gint`, decode speed tier
- `distance`: `gdouble`, maximum encoding error
- `effort`: `gint`, encoding effort
- `lossless`: `gboolean`, enables lossless compression
- `Q`: `gint`, quality setting
- `bitdepth`: `gint`, image bitdepth.

This method is not directly available to language bindings.

#### Parameters

`filename`

  Type: `const char*`

  File to write to.

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

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.