magick图像调整大小(magick image resize)
我在R中使用
magick
库我正在使用以下命令,但它无法正常工作
shoe <- image_read('F:/photo.jpg') image_scale(shoe,'382x509') format width height colorspace filesize JPEG 382 460 sRGB 0
宽度设置为382但不是高度。 所以我通过下面的命令设置高度
image_scale(shoe,'X509') format width height colorspace filesize JPEG 423 509 sRGB 0
现在它改变了宽度。 有没有办法在调整大小时关闭宽高比?
I am using
magick
library in R.I am using the following command but it is not working correctly
shoe <- image_read('F:/photo.jpg') image_scale(shoe,'382x509') format width height colorspace filesize JPEG 382 460 sRGB 0
The width is set to 382 but not height. so I set height by following command
image_scale(shoe,'X509') format width height colorspace filesize JPEG 423 509 sRGB 0
Now it changed the width. Is there any way to turn off the aspect ratio while resizing?
原文:https://stackoverflow.com/questions/43119047
更新时间:2022-04-14 12:04