Rotation and scaling can be done in the canvas:
The drawImage method can be called with three different sets of arguments:
drawImage(image, dx, dy) drawImage(image, dx, dy, dw, dh) drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh)
Each of these three can accept either HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement for the image argument.
context . drawImage(image, dx, dy) context . drawImage(image, dx, dy, dw, dh) context . drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh)
Draws this image on canvas. The arguments are interpreted as follows:

This together with
context . rotate(angle)
can be used for rotation and scaling.
Anil Shanbhag
source share