0

I recently discovered a command line picture editing tool Imagemagick which has a tool called mogrify. I would like someone to explain the -extract command (See here if you need reference)

Let me show you'll what I did. This is the original image:

example image

I then made two copies of this (using any command edits the original file). To the first i used the command

mogrify -extract 500x500+224+202 '/home/ashhab/Desktop/Abstract_Wallpaper (copy).jpg'

Then i get this

example image

For the second I used this command

mogrify -extract 500x500 '/home/ashhab/Desktop/Abstract_Wallpaper (another copy).jpg'

and i get this

example image

The command can be explained as

mogrify -extract (size)(offset) [file path]

So my question is what does the offset(+224+202) actually do? what does offset mean?

1 Answer 1

0

The offset means the location where it should start extracting the image. So an offset of +224+202 means go 224 to the right and 202 to the bottom and from that point take out the 500x500 pixels you want (In this case it will be pixels but it can also be a percentage).


From your link If you omit the offsets, as in ... the image is resized to the specified dimensions instead. So the 3rd one is a 500x500 version of the original and it is zoomed but zoomed out.

2
  • but looking at img 2 , it seems to be to be just a zoomed in version but img 3 does not seem to be
    – Ashu
    May 19, 2012 at 18:49
  • so you mean the extract command becomes the resize command without the offsets... how odd!!
    – Ashu
    May 19, 2012 at 19:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .