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 OptimizationDeclaration
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 QualityDeclaration
Swift
public func qualiy(_ quality: UInt) -> ImageTransform
-
The
format
parameter lets you converts a given image from one format to another. See Convert FormatsDeclaration
Swift
public func format(_ format: Format) -> ImageTransform
-
The
width
parameter lets you dynamically resize the width of the image by specifying pixels or percentage. Theheight
parameter lets you dynamically resize the height of the image by specifying pixels or percentage. Thedisable
parameter disables the functionality that is enabled by default. See Resize ImagesDeclaration
Swift
public func resize(_ resize: Resize) -> ImageTransform
-
The
crop
parameter allows you to remove pixels from an image. See Crop ImagesDeclaration
Swift
public func crop(_ crop: Crop) -> ImageTransform
-
The
trim
parameter lets you trim an image from the edges. See Trim ImagesDeclaration
Swift
public func trim(_ edgeInset: NSEdgeInsets) -> ImageTransform
-
The
orient
parameter lets you control the cardinal orientation of the given image. See Reorient ImagesDeclaration
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 SettingsDeclaration
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 PadDeclaration
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 PadDeclaration
Swift
public func pad(_ padding: NSEdgeInsets) -> ImageTransform
-
The
bg-color
parameter lets you set a backgroud color for the given image. See Background ColorDeclaration
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 RatioDeclaration
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 BlurDeclaration
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 SaturationDeclaration
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 ContrastDeclaration
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 BrightnessDeclaration
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 SharpenDeclaration
Swift
public func sharpen(amount: UInt, radius: UInt, threshold: UInt) -> ImageTransform