通过调整大小,可以更改图像的width和height 。 新图像的背景颜色为空白区域,以hex value给出。 如果未提供背景参数,则PNG图像默认为透明, JPEG为白色

上面的代码将获取以下输出 -