ImageTransform

public class ImageTransform

The Image Delivery API is used to retrieve, manipulate and/or convert image files of your Contentstack account and deliver it to your web or mobile properties See Image Delivery API

  • The auto parameter lets you enable the functionality that automates certain image optimization features. See Automate Optimization

    Declaration

    Swift

    public func auto() -> ImageTransform
  • The quality parameter lets you control the compression level of images that have Lossy file format. The value for this parameters can be entered in any whole number (taken as a percentage) between 1 and 100. See Control Quality

    Declaration

    Swift

    public func qualiy(_ quality: UInt) -> ImageTransform
  • The format parameter lets you converts a given image from one format to another. See Convert Formats

    Declaration

    Swift

    public func format(_ format: Format) -> ImageTransform
  • The width parameter lets you dynamically resize the width of the image by specifying pixels or percentage. The height parameter lets you dynamically resize the height of the image by specifying pixels or percentage. The disable parameter disables the functionality that is enabled by default. See Resize Images

    Declaration

    Swift

    public func resize(_ resize: Resize) -> ImageTransform
  • The crop parameter allows you to remove pixels from an image. See Crop Images

    Declaration

    Swift

    public func crop(_ crop: Crop) -> ImageTransform
  • The canvas parameter allows you to increase the size of the canvas that surrounds an image. See Canvas

    Declaration

    Swift

    public func canvas(_ canvas: Canvas) -> ImageTransform
  • The fit parameter enables you to fit the given image properly within the specified height and width. You need to provide values for the height, width and fit parameters. See Fit Mode

    Declaration

    Swift

    public func fit(_ fit: Fit) -> ImageTransform
  • The trim parameter lets you trim an image from the edges. See Trim Images

    Declaration

    Swift

    public func trim(_ edgeInset: NSEdgeInsets) -> ImageTransform
  • The orient parameter lets you control the cardinal orientation of the given image. See Reorient Images

    Declaration

    Swift

    public func orient(_ orient: Orientation) -> ImageTransform
  • The overlay parameter allows you to put one image on top of another. You need to specify the relative URL of the image as value for this parameter. SeeOverlay Settings

    Declaration

    Swift

    public func overlay(relativeUrl: String, overlayTypes: [OverlayType] = []) -> ImageTransform
  • The overlay-pad parameter allows you to add padding pixels to the edges of an overlay image. You need to specify the relative URL of the image as value for this parameter. See Overlay Pad

    Declaration

    Swift

    public func overlay(relativeUrl: String, padding: NSEdgeInsets) -> ImageTransform
  • The pad parameter lets you add extra pixels to the edges of an image. This is useful if you want to add whitespace or border to an image. The value for this parameter can be given in pixels or percentage. See Pad

    Declaration

    Swift

    public func pad(_ padding: NSEdgeInsets) -> ImageTransform
  • The bg-color parameter lets you set a backgroud color for the given image. See Background Color

    Declaration

    Swift

    public func backgroundColor(_ color: Color) -> ImageTransform
  • The dpr parameter lets you deliver images with appropriate size to devices that come with a defined device pixel ratio. See Device Pixel Ratio

    Declaration

    Swift

    public func dpr(_ dpr: UInt, resize: Resize) -> ImageTransform
  • The blur parameter allows you to decrease the focus and clarity of a given image. See Blur

    Declaration

    Swift

    public func blur(_ blur: UInt) -> ImageTransform
  • The saturation parameter allows you to increase or decrease the intensity of the colors in a given image. See Saturation

    Declaration

    Swift

    public func saturation(_ value: Double) -> ImageTransform
  • The contrast parameter allows you to increase or decrease the difference between the darkest and lightest tones in a given image. See Contrast

    Declaration

    Swift

    public func contrast(_ value: Double) -> ImageTransform
  • The brightness parameter allows you to increase or decrease the intensity with which an image reflects or radiates perceived light. See Brightness

    Declaration

    Swift

    public func brightness(_ value: Double) -> ImageTransform
  • The frame parameter fetches the first frame from an animated GIF (Graphics Interchange Format) file that comprises a sequence of moving images. See Fetch first frame

    Declaration

    Swift

    public func fetchFirstFrame() -> ImageTransform
  • The sharpen parameter allows you to increase the definition of the edges of objects in an image. See Sharpen

    Declaration

    Swift

    public func sharpen(amount: UInt, radius: UInt, threshold: UInt) -> ImageTransform