I've implemented a background color modification based on this post
But I want to modify my image size and when I set it below 60%, the image is cropped instead of being resized.
I saw that the problem come from the function
You needed to pass the image width/height when using
var ctx = canvas.getContext("2d"); ctx.drawImage(imgElement,0,0,canvas.width,canvas.height);