I have come up with a function which transform the width and height of an image to new values,
function imageToDataUri(src, width, height) { // create an