-
-
Save dahlia/5592282 to your computer and use it in GitHub Desktop.
Response to Nicolas de Bari Embriz Garcia Rojas <[email protected]>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wand.color import Color | |
from wand.image import Image | |
with Image(background=Color('black'), width=1280, height=720) as result: | |
with Image(filename='source.jpg') as image: | |
result.composite( | |
image, | |
(result.width - image.width) / 2, | |
(result.height- image.height) / 2 | |
) | |
result.save(filename='result.jpg') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIME-Version: 1.0 | |
Date: Thu, 16 May 2013 14:48:35 +0100 | |
From: Nicolas de Bari Embriz Garcia Rojas <[email protected]> | |
List-Archive: <http://librelist.com/archives/wand/> | |
List-Id: [email protected] | |
List-Post: <mailto:[email protected]> | |
Reply-To: [email protected] | |
Sender: [email protected] | |
Subject: [wand] how to crop defining -gravity and -extent etc | |
To: [email protected] | |
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. |
nbari
commented
May 16, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment