Rotates a ColdFusion image at a specified point by a specified angle.

imageRotate(name, angle [, x] [, y] [, interpolation]) → returns void

Member Function Syntax

someImage.rotate(angle [, x] [, y] [, interpolation])

imageRotate Argument Reference


The image on which this operation is performed.


The rotation angle in degrees.

Default: 2

The x coordinate for the point of rotation

Default: 2

The y coordinate for the point of rotation


Type of interpolation Values:
  • nearest: Applies the nearest neighbor method of interpolation. Image quality is lower than the other interpolation methods, but processing is fastest (default).
  • bilinear: Applies the bilinear method of interpolation. The quality of the image is less pixelated than the default, but processing is slower.
  • bicubic: Applies the bicubic method of interpolation. Generally, the quality of image is highest with this method and processing is slowest.

Examples sample code invoking the imageRotate function

Tag Syntax

This example shows how to rotate an image by 10 degrees.

<!--- Create a ColdFusion image from an existing JPEG file. ---> 
 <cfset myImage=imageNew("../cfdocs/images/artgallery/jeff05.jpg")> 
 <cfset imageSetAntialiasing(myImage,"on")> 
 <!--- Rotate the image by 10 degrees. ---> 
 <cfset imageRotate(myImage,10)> 
 <cfimage source="#myImage#" action="writeToBrowser"> 

Using rotate member function

CF 11+ Rotate an image

imgObj = imageRead("");
cfimage(action="writeToBrowser", source=imgObj);

Fork me on GitHub