-->

Monday, September 24, 2012

ImageMagick pills


# resize and crop

convert -resize 400x400 -crop 150x150+0+0 -gravity center ./albums/20090807/P1040432.JPG test.jpg; display test.jpg

remember the -gravity center option


# check if the image is grayscale (Type: Grayscale , only 1 channel ) or color  ( Type: TrueColor, 3 channels)

 convert 9*  -colorspace rgb -verbose info: | grep " Type:"

# make image mosaic 

montage zelda3b.jpg zelda3b.jpg zelda3b.jpg \
zelda3b.jpg zelda3b.jpg zelda3b.jpg \
zelda3b.jpg zelda3b.jpg zelda3b.jpg \
-tile 3x3 -geometry +7+7 miff:- | \
convert - -bordercolor white -border 7 zelda_montage.jpg


# resize files with specific interpolation respecting the proportions!

convert -filter bessel -resize 800 infile.jpg outfile.jpg 

number of pixels respecting the proportions. 


# resize using percentage of the whole image

mogrify -resize 30%

# resize and crop kind of smartly

mogrify  -resize 180x180 -gravity center -crop 120x120+0+0 beautiful_color_sel_4/*

No comments:

Post a Comment