trait ImageFlagTrait

Trait ImageFlagTrait

Methods

animated()

Used when delivering a video file as an image format that supports animation, such as animated WebP.

anyFormat()

When used together with automatic quality (q_auto): allow switching to PNG8 encoding if the quality algorithm decides that it's more efficient.

animatedPng()

When converting animated images to PNG format, generates an animated PNG from all the frames in the original animated file instead of only from the first still frame.

animatedWebP()

When converting animated images to WebP format, generate an animated WebP from all the frames in the original animated file instead of only from the first still frame.

clip()

Trims pixels according to a clipping path included in the original image (e.g., manually created using PhotoShop).

clipEvenOdd()

Trims pixels according to a clipping path included in the original image (e.g., manually created using PhotoShop) using an evenodd clipping rule.

lossy()

Automatically use lossy compression when delivering animated GIF files.

preserveTransparency()

When used with automatic fetch_format (f_auto): ensures that images with a transparency channel will be delivered in PNG format.

png8()

Generate PNG images in the PNG8 format.

png24()

Generates PNG images in the PNG24 format.

png32()

Generates PNG images in the PNG32 format.

progressive(string $mode = null)

Generates a JPG image using the progressive (interlaced) JPG format.

rasterize()

Reduces the image to one flat pixelated layer (as opposed to the default vector based graphic) in order to enable PDF resizing and overlay manipulations.

sanitize()

Instructs Cloudinary to run a sanitizer on the image (relevant only for the SVG format).

stripProfile()

Instructs Cloudinary to clear all ICC color profile data included with the image.

tiff8Lzw()

Generates TIFF images using LZW compression and in the TIFF8 format.

ignoreMaskChannels()

A qualifier that ensures that an alpha channel is not applied to a TIFF image if it is a mask channel.

Details

static FlagQualifier animated()

Used when delivering a video file as an image format that supports animation, such as animated WebP.

Plays all frames rather than just delivering the first one as a static image. Use this flag in addition to the flag or qualifier controlling the delivery format, for example f_auto or fl_awebp.

Note: When delivering a video in GIF format, it is delivered as an animated GIF by default and this flag is not necessary. To deliver a single frame of a video in GIF format, use the page qualifier.

Return Value

FlagQualifier

static FlagQualifier anyFormat()

When used together with automatic quality (q_auto): allow switching to PNG8 encoding if the quality algorithm decides that it's more efficient.

Return Value

FlagQualifier

static FlagQualifier animatedPng()

When converting animated images to PNG format, generates an animated PNG from all the frames in the original animated file instead of only from the first still frame.

Note that animated PNGs are not supported in all browsers and versions.

Return Value

FlagQualifier

static FlagQualifier animatedWebP()

When converting animated images to WebP format, generate an animated WebP from all the frames in the original animated file instead of only from the first still frame.

Note that animated WebPs are not supported in all browsers and versions.

Return Value

FlagQualifier

static FlagQualifier clip()

Trims pixels according to a clipping path included in the original image (e.g., manually created using PhotoShop).

Return Value

FlagQualifier

static FlagQualifier clipEvenOdd()

Trims pixels according to a clipping path included in the original image (e.g., manually created using PhotoShop) using an evenodd clipping rule.

Return Value

FlagQualifier

static FlagQualifier lossy()

Automatically use lossy compression when delivering animated GIF files.

This flag can also be used as a conditional flag for delivering PNG files: it tells Cloudinary to deliver the image in PNG format (as requested) unless there is no transparency channel - in which case deliver in JPEG format.

Return Value

FlagQualifier

static FlagQualifier preserveTransparency()

When used with automatic fetch_format (f_auto): ensures that images with a transparency channel will be delivered in PNG format.

Return Value

FlagQualifier

static FlagQualifier png8()

Generate PNG images in the PNG8 format.

Return Value

FlagQualifier

static FlagQualifier png24()

Generates PNG images in the PNG24 format.

Return Value

FlagQualifier

static FlagQualifier png32()

Generates PNG images in the PNG32 format.

Return Value

FlagQualifier

static FlagQualifier progressive(string $mode = null)

Generates a JPG image using the progressive (interlaced) JPG format.

This format allows the browser to quickly show a low-quality rendering of the image until the full-quality image is loaded.

Parameters

Name Type Description
$mode string The mode to determine a specific progressive outcome as follows: * semi - A smart optimization of the decoding time, compression level and progressive rendering (less iterations). This is the default mode when using q_auto. * steep - Delivers a preview very quickly, and in a single later phase improves the image to the required resolution. * none - Use this to deliver a non-progressive image. This is the default mode when setting a specific value for quality.

Return Value

FlagQualifier

See also

Progressive

static FlagQualifier rasterize()

Reduces the image to one flat pixelated layer (as opposed to the default vector based graphic) in order to enable PDF resizing and overlay manipulations.

Return Value

FlagQualifier

static FlagQualifier sanitize()

Instructs Cloudinary to run a sanitizer on the image (relevant only for the SVG format).

Return Value

FlagQualifier

static FlagQualifier stripProfile()

Instructs Cloudinary to clear all ICC color profile data included with the image.

Return Value

FlagQualifier

static FlagQualifier tiff8Lzw()

Generates TIFF images using LZW compression and in the TIFF8 format.

Return Value

FlagQualifier

static FlagQualifier ignoreMaskChannels()

A qualifier that ensures that an alpha channel is not applied to a TIFF image if it is a mask channel.