Contents

heifRepresentation(of:format:colorSpace:options:)

Renders the image and exports the resulting image data in HEIF format.

Declaration

func heifRepresentation(of image: CIImage, format: CIFormat, colorSpace: CGColorSpace, options: [CIImageRepresentationOption : Any] = [:]) -> Data?

Parameters

Return Value

A data representation of the rendered image in HEIF format, or nil if the image could not be rendered.

Discussion

To render an image for export, the image’s contents must not be empty and its extent dimensions must be finite. To export after applying a filter whose output has infinite extent, see the clampedToExtent() method.

See Also

Rendering Images for Data or File Export