Google Code offered in: 中文 - English - Português - Pусский - Español - 日本語
The google.appengine.api.images
package provides the following functions:
Resizes an image, scaling down or up to the given width and height. The function takes the image data to resize, and returns the transformed image in the same format.
Arguments:
str
) in JPEG, PNG, GIF (including animated), BMP, TIFF, or ICO format.int
or long
.int
or long
.images.PNG
or images.JPEG
. The default is images.PNG
.Crops an image to a given bounding box. The function takes the image data to crop, and returns the transformed image in the same format.
The left, top, right and bottom of the bounding box are specified as proportional distances. The coordinates of the bounding box are determined as left_x * width
, top_y * height
, right_x * width
and bottom_y * height
. This allows you to specify the bounding box independently of the final width and height of the image, which may change simultaneously with a resize action.
Arguments:
str
) in JPEG, PNG, GIF (including animated), BMP, TIFF, or ICO format. float
value from 0.0 to 1.0 (inclusive).float
value from 0.0 to 1.0 (inclusive).float
value from 0.0 to 1.0 (inclusive).float
value from 0.0 to 1.0 (inclusive).images.PNG
or images.JPEG
. The default is images.PNG
.Rotates an image. The amount of rotation must be a multiple of 90 degrees. The function takes the image data to rotate, and returns the transformed image in the same format.
Rotation is performed clockwise. A 90 degree turn rotates the image so that the edge that was the top becomes the right edge.
Arguments:
str
) in JPEG, PNG, GIF (including animated), BMP, TIFF, or ICO format. images.PNG
or images.JPEG
. The default is images.PNG
.Flips an image horizontally. The edge that was the left becomes the right edge, and vice versa. The function takes the image data to flip, and returns the transformed image in the same format.
Arguments:
str
) in JPEG, PNG, GIF (including animated), BMP, TIFF, or ICO format. images.PNG
or images.JPEG
. The default is images.PNG
.Flips an image vertically. The edge that was the top becomes the bottom edge, and vice versa. The function takes the image data to flip, and returns the transformed image in the same format.
Arguments:
str
) in JPEG, PNG, GIF (including animated), BMP, TIFF, or ICO format. images.PNG
or images.JPEG
. The default is images.PNG
.Adjusts the contrast and color levels of an image according to an algorithm for improving photographs. This is similar to the "I'm Feeling Lucky" feature of Google Picasa. The function takes the image data to adjust, and returns the transformed image in the same format.
Arguments:
str
) in JPEG, PNG, GIF (including animated), BMP, TIFF, or ICO format. images.PNG
or images.JPEG
. The default is images.PNG
.Note: The im_feeling_lucky()
method is no-op when used locally in the SDK as there is no equivilent method in PIL.