### Method

# Vips Image uhdrsave

#### Declaration [src]

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

#### Description [src]

Save an image as UltraHDR.

If an image is sRGB and has a gainmap, it will be saved as UltraHDR with no gainmap recomputation.

If the image is scRGB and has a gainmap, a base image will be computed and it will be saved as UltraHDR.

If the image is scRGB and has no gainmap, one will be computed at a `gainmap_scale_factor` of the base image. This is slow and takes a lot of memory.

Optional arguments

- `Q`: `gint`, quality factor
- `gainmap_scale_factor`: `gint`, scale factor of base image to gainmap

See also

`vips_image_write_to_file()`, `vips_uhdrload()`.

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.