Search code examples
imageimage-processingvips

Resizing + stretching with vipsthumbnail?


I'm using vipsthumbnail to resize images via the command line.

I would like to know if there is a way to resize an image and ignore its aspect ratio, so that no matter what size if I passed 5x500 I would get a 5px by 500px image.

I can't fine anything in the documentation.

I'm using the lib on macOS.


Solution

  • From libvips 8.6, vipsthumbnail supports imagemagick-style size specifications. For example:

    vipsthumbnail k2.jpg --size "50x50!"
    

    will resize to 50x50 pixels whatever the size of the input image. There's a chapter in the docs about using vipsthumbnail:

    http://libvips.github.io/libvips/API/current/Using-vipsthumbnail.md.html