Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
992 views
in Technique[技术] by (71.8m points)

imagemagick - vipthumbnail resizing image without aspect ratio

i want to resize my 800x800px image into 500x1000px using libvips vipthumbnails.

we know that we can force vipthumbnail to ignore aspect ratio and do whatever dimension we want but it will simply distort the image.

resizing 800x800px image to 500x1000px will simply distort the image if we force to follow the given dimension

we simply wants to resize first to 500x500px and then on longer side add the white space in both direction equally distributed. in this case given width is 1000px so both side we will add 250px white space and align the 500x500px part in centre.

so the final image will be 500x1000px and 500x500px image with proper aspect ratio in that frame

      vipsthumbnail "/path/original.jpg" --size 500x -o "/path/resize.jpg"[Q=90]

any help will be great. i dont want to use imagemagick as it consumes more memory

question from:https://stackoverflow.com/questions/65856675/vipthumbnail-resizing-image-without-aspect-ratio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...