Alfresco provides the following APIs for image transformations.
transformImage is overloaded with different parameters. You can use any of these based on your requirement:
transformImage(string mimetype):This will transform an image to a new type specified in
mimetypeand will return the transformed image node if successful ...