How to zoom on a image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
camilleroux

How to zoom on a image

Post by camilleroux »

Hi,

I'm looking for a command line (with "convert") to create, for exemple, a 250x250 picture from a 1000x1000 where we see only the [0-125]x[0-125] top left corner part (resize + 2x zoom in fact).

Thank you
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: How to zoom on a image

Post by Bonzo »

This will crop the image and possibly resize it; I always tend to be resizing smaller not increasing the size.

Code: Select all

convert original.jpg -crop 125x125+0+0 -resize 250x250 new_image.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to zoom on a image

Post by anthony »

If you like the resize to 'pixelate' the image when enlarging set "-filter Pixel" or better still use the faster "-scale" resize operator.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply