UIImage

extension UIImage
  • Compress the instance of the image.

    Declaration

    Swift

    public func compressedImage(compressRatio: CGFloat, maxCompressRatio: CGFloat = 0.1) -> UIImage

    Parameters

    compressRatio

    Ratio to use for compressing the image.

    maxCompressRatio

    Maximum ratio where the image can be compress.

  • Redraw scaled down image respecting originally captured orientation settings.

    Declaration

    Swift

    public func scaledDownImage(to size: CGSize) -> UIImage?

    Parameters

    size

    Reference size in scaling the image.