Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently dicovered 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
enter image description here

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
enter image description here
For the second i used this command
mogrify -extract 500x500 '/home/ashhab/Desktop/Abstract_Wallpaper (another copy).jpg'
and i get this
enter image description here
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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
    
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 '12 at 18:49
    
so you mean the extract command becomes the resize command without the offsets... how odd!! –  Ashu May 19 '12 at 19:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.