Static Method

decompress(path:)

Decompresses and decodes a PNG from a file at the given file path.

Declaration

static func decompress(path:String) throws -> Self?

Parameters

path

A path to a PNG file.

Return value

The decoded image, or nil if the file at the given path could not be opened.

Overview

This interface is only available on MacOS and Linux. The decompress(stream:) function provides a platform-independent decoding interface.

Topics

See also

static func decompress<Source>(stream:inout Source) throws -> Self

Decompresses and decodes a PNG from the given bytestream.

func compress(path:String, level:Int, hint:Int) throws -> Void?

Encodes and compresses a PNG to a file at the given file path.