Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The media services consist of services which allows retrieving images and files, collectively called Binaries, out of Perfion. The Media Services API is hosted on a Microsoft IIS Web Server. The services are designed according to a pull-strategy such that it scales linearly.

...

URL Parameter

Description

format

Changes returned image format to defined format.

Value: image format, e.g. JPG, PNG, etc.

Supported image formats: BMP, GIF, JPG, JPEG, PNG, EPS, PSD, PDF, TIF, TIFF, SVG, WEBP, AVIF

dpi

Scales the image exactly to the specified resolution.

This parameter cannot be combined with the size or fit parameters. For precision, the parameter value can include a decimal separator (use the period character ‘.’).

Value: decimal number

size

Defines the size in pixels (width x height). The pixels must be expressed in whole integer numbers, i.e. no decimal points are allowed.

The size can be interpreted in several ways since it is possible to define width and height ratios that are not equivalent to the original image. How the size is interpreted is controlled by the fit parameter. The default behavior is to scale the image to fit within the specified size by keeping the aspect ratio.

Value: <width>x<height>, where width and height are integer numbers.

Info

Note: Perfion does not support scaling of vector formats like SVG and EPS. Vector formats will be converted into raster format, if a specific size is requested.

fit

Controls how to interpret the size parameter behavior. It can only be used together with size parameter.

Value:

  • fit (default). Default behavior equivalent to omitting the parameter. Scale the image to fit within the specified size by keeping the aspect ratio.

  • exact. Scale the image to fit the specified size exactly. If the specified size does not have the same proportions as the original image, then the image will be stretched in one or the other dimension

  • crop. Scale the image to fit the specified size exactly. If the specified size does not have the same proportions as the original image, then the image will be cropped either at the sides or at the top/bottom thereby leaving the contents of the image undistorted

  • smart. Scale the image to fit the specified size exactly. If the specified size does not have the same proportions as the original image, then the image is adjusted via a 50% combination of the above exact and crop fitting methods, i.e. the image is cropped a little less and stretched a little less.

  • aspectratio. Image is resized to the new size by keeping the aspect ratio so that it fits best and then the remaining area (if the new size does not match the original image aspect ratio) is filled using a color which can be specified using canvascolor parameter.

canvascolor

The requested canvas color of the image. It is only usable when image is resized using size parameter together with fit parameter set to aspectratio.

The color must be specified as RGB or ARGB color code in hexadecimal format by using 6 (RGB) or 8 (ARGB) char color code. In case of 8 char color code, the first 2 characters represent the alpha channel value.

Value: hexadecimal color value, e.g. ccff33.

backgroundcolor

Adds a color to transparent parts of the image.

This only works when the target image format does not support transparency and the source image format has transparency. In such case the source image transparency will be replaced with background color.

Value: hexadecimal color value, e.g. ccff33.

quality

Image compression quality in percent. 

Supported only for JPG and PNG format images.  

Value: integer value >0 and <=100.

Default value: 90.

tiffcomp

TIFF compression method.

Values: LZW (Lempel-Ziv and Welch compression), ZIP (Deflate compression) or None. Default value is LZW.

The parameter can be used only if the target image format is a TIFF image.

colorprof

The color profile of the target image. It is only usable with images which support color profiles. If specified the image colors will be converted to that color profile and the profile itself will be embedded to the image file.

Values: Original (keep the original color profile), CMYK (Coated FOGRA39), sRGB, AdobeRGB1998, ProPhoto.

usepoi

The request to use the Point-of-Interest (POI) of the image if it has POI specified in its metadata. If image does not have POI specified or the POI is not used, then POI will be equivalent to value 50x50 which is the center of the image.

Values: 0 (do not use POI) and 1 (use POI). Default value: 0.

The parameter can only be used with size and fit parameters when fit parameter is set to crop or smart.

poi

The request to use the custom Point-of-Interest (POI) of the image. This parameter can only be used if usepoi is used and set to ‘1’. If this parameter is used, then it will overwrite the original image POI value saved as its metadata.

Value is of format <X>x<Y> where X and Y are relative image horizontal and vertical coordinates expressed in %. The reference point is image top right corner which will have value 0x0. The bottom right corner of the image will have value 100x100. The center of the image will have value 50x50.

Values for X and Y coordinates must be integer values >=0 and <=100. 

The parameter can only be used with size and fit parameters when fit parameter is set to crop or smart.

...

Info

NOTE: Watermarked image service and other image services do not allow processing of file type binaries even if the file type binary is of image format.

Info

Note: Perfion does not support applying watermarking on vector formats like SVG and EPS. If watermarking is enabled, vector formats will be converted into raster format, before the watermark is applied.

Watermark Sizing and Appearance

...

Service name

File

Image

ImageW

ImageUncached

File type binaries

Yes

Yes

No

Yes

File type binaries which have image format

Yes

Yes

No

Yes

Image type binaries

Yes

Yes

Yes

Yes

Process image (resize, change format, etc.) – file type binary

No

No

No

No

Process image (resize, change format, etc.) – image type binary

Yes

Yes

Yes

Yes

Watermark image

No

Yes

Yes

Yes

HTTP GET vs. HTTP HEAD Request

...