librelist archives

« back to archive

how to crop defining -gravity and -extent etc

how to crop defining -gravity and -extent etc

From:
Nicolas de Bari Embriz Garcia Rojas
Date:
2013-05-16 @ 13:48
Hi, I need to crop an image multiple times changing the offset.
currently I use the following command line:

convert image.jpg -crop 1280x720+0+0 -gravity center -background black
-sharpen 0x.5 -quality 75 -extent 1280x720 ppm:-
convert image.jpg -crop 1280x720+1+2 -gravity center -background black
-sharpen 0x.5 -quality 75 -extent 1280x720 ppm:-
convert image.jpg -crop 1280x720+2+4 -gravity center -background black
-sharpen 0x.5 -quality 75 -extent 1280x720 ppm:-
...
...
...

Any idea of how to do it using wand ?

currently I am using python subprocess but would like to use wand since
I notice is faster.

regards.

Re: [wand] how to crop defining -gravity and -extent etc

From:
Hong Minhee
Date:
2013-05-16 @ 14:56
Hi Nicolas,

Although we already had conversation in the IRC channel, but it’s just for
archive:

  https://gist.github.com/dahlia/5592282

It might help for others as well.


Thanks,
Hong Minhee

On May 16, 2013, at 10:48 PM, Nicolas de Bari Embriz Garcia Rojas 
<nbari@inbox.im> wrote:

> Hi, I need to crop an image multiple times changing the offset.
> currently I use the following command line:
> 
> convert image.jpg -crop 1280x720+0+0 -gravity center -background black
> -sharpen 0x.5 -quality 75 -extent 1280x720 ppm:-
> convert image.jpg -crop 1280x720+1+2 -gravity center -background black
> -sharpen 0x.5 -quality 75 -extent 1280x720 ppm:-
> convert image.jpg -crop 1280x720+2+4 -gravity center -background black
> -sharpen 0x.5 -quality 75 -extent 1280x720 ppm:-
> ...
> ...
> ...
> 
> Any idea of how to do it using wand ?
> 
> currently I am using python subprocess but would like to use wand since
> I notice is faster.
> 
> regards.