Show Menu
TOPICS×

rect

Final view rectangle. Allows the final view image to be disassembled into several strips or tiles, which can be delivered separately and reassembled by the client seamlessly, with no artifacts along the edges.
rect= * coord *, * size *[, * scale *]
coord
Pixel offset from the top-left corner of the view image to the top-left of the view rectangle (int, int), expressed in pixels, after scale is applied.
size
Size of the ROI in pixels (int, int). Specifies the reply image size. The image is filled with bgc= in areas not covered by the view image (or left transparent, if fmt=*-alpha is present in the request).
scale
Scale factor (real). Values smaller than 1.0 reduce the resolution, and values larger than 1.0 increase the resolution.
Using this command, Image Serving can deliver large images via HTTP which would otherwise exceed the size limit configured with attribute::MaxPix .
For best results when JPEG compression is used, the strip or tile size should be a multiple of the JPEG encoding tile size (16x16 pixels).

Example

Separate a printable CMYK image into several full-resolution strips to reduce the download file sizes. If we were to request a contiguous image:
http://server/is/image/cat/imageId?scl=1&op_usm=.9,2&bgc=ffffff&fmt=tif&icc=WebCoated
First, relevant information about the image is obtained:
http://server/is/image/cat/imageId?scl=1&op_usm=.9,2&bgc=ffffff&req=props
The text response includes these properties:
image.width=2000 image.height=2400 image.version=37JK6NTvpvC42F5gOuLEVY
Based on this information, we decide that we want four 600x2000 pixel strips. The rect= command is used to describe the strip sizes and positions.
Since this image is changed frequently, we will include the id= command to minimize the chance that we end up with one or more strips from an older version of the image which may have been cached in a CDN or proxy server. The value of the image.version property is used for this purpose.
http://server/is/image/cat/imageId?scl=1&op_usm=.9,2&bgc=ffffff&id=37JK6NTvpvC42F5gOuLEVY&rect=0,0,2000,600 http://server/is/image/cat/imageId?scl=1&op_usm=.9,2&bgc=ffffff&id=37JK6NTvpvC42F5gOuLEVY&rect=0,600,2000,600 http://server/is/image/cat/imageId?scl=1&op_usm=.9,2&bgc=ffffff&id=37JK6NTvpvC42F5gOuLEVY&rect=0,1200,2000,600 http://server/is/image/cat/imageId?scl=1&op_usm=.9,2&bgc=ffffff&id=37JK6NTvpvC42F5gOuLEVY&rect=0,1800,2000,600

Properties

View attribute. Applies regardless of the current layer setting.
Any areas of the ROI extending outside the view image are padded with bgc= .
Important rect= is applied after final scaling and fitting with scl= , wid= , hei= , fit= , rgn= , and align= .

Default

Entire, unmodified view image ( rect=0,0,width,height,1.0 ).