CompressTransform

public class CompressTransform : Transform

Utilizes mozjpeg to offer improved compression for JPGS over the algorithm used for output=compress:true. It will not attempt to re-compress a previously compressed image.

For the best results, compress should be the last task in your transformation chain.

Important

Works only with PNG and JPG files.

Lifecycle

  • Initializes a CompressTransform object.

    Declaration

    Swift

    public init()

Public Functions

  • Adds the metadata option.

    Declaration

    Swift

    @discardableResult
    func metadata(_ value: Bool) -> Self

    Parameters

    value

    Sets if we want to keep metadata while compressing.