API Development

Featured Module — Image Factory

This month’s module is the top installed module this month, and one built by Axway that provides an additional set of image transformation functions for images, including scaling, compressing, adding alpha channels and more.

Getting started is easy — you can install it from http://gitt.io using the Gitt.io CLI or download a release Zip file from the Image Factory repository.

Some of the methods you can use include:

imageWithRotation
Creates a new image by creating a copy of the given image that is rotated.

imageWithAlpha
Creates a new image by creating a copy of the given image, adding an alpha channel if it doesn’t already have one.

imageWithTransparentBorder
Creates a new image by creating a copy of the given image, adding a transparent border of the given size around its edges. The size of the image will be expanded by the specified border size.

imageWithRoundedCorner
Creates a new image by creating a copy of the given image with rounded corners.

imageAsThumbnail
Creates a new image by creating a copy of the given image that is squared to the thumbnail size.

imageAsResized
Creates a new image by creating a copy of the given image that is rescaled to the specified size.

imageAsCropped
Creates a new image by creating a copy of the given image that is cropped to the specified bounds.

imageTransform
Creates a new image by applying a sequence of transformations to the image.

compress
Creates a new image by creating a copy of the given image and applying the specified compression quality.

Of course there are also image manipulation methods built into the Titanium API, so worth checking them out but as image factory remains a popular module on Gitt.io then it’s worth including in this series.

Let us know in the comments if you use ImageFactory, how you use it and your feedback — do you find it useful? Is there something better?

Leave a comment with any modules you’d like to see featured in this series.

Happy Coding!