If not specified, the axis is the center of the element. Here you need to take care of the position that you applied to the images and the scaling that will be performed. Since in this case your scaling is relative to the upper left corner of the image, we can simply multiply the center coordinate by it.
// Compute rotation pivot coordinates var scaling = 1.5; rx = (x + (img_width / 2)) * scaling; ry = (y + (img_height / 2)) * scaling; // Apply transformations image1.transform("S1.5,1.5,0,0R45"); image2.transform("S1.5,1.5,0,0R45,"+rx+","+ry);
http://jsfiddle.net/TYCJ7/
source share