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?
To resize an image to specific dimensions, use the convert command with an input file, the -resize parameter, your preferred dimensions, and an output filename: convert original. png -resize 100x100 new. png.
If you're not sure what ImageMagick is, it's one of the greatest tools you could have on your computer, to manipulate images and a few other types of files.
GraphicsMagick was considerably executing image processing operations faster than ImageMagick 6.5. 8-10. You can also check it by doing some type of processing on both of the software one by one.
Reading the original documentation here brings the solution:
image_scale(shoe,"382x509!")
# format width height colorspace filesize
#1 JPEG 382 509 sRGB 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With