Wednesday, August 28, 2013

ImageMagick: batch resize and DPI change

mogrify -resize 59.06% -density 150x150 *.tif
mogrify -resize 1024x1234 -density 150x150 *.tif
If the images are in grayscale than the above will convert them to RGB. Thus one can use the following: mogrify -resize 59.06% -density 150x150 -colorspace gray -layers flatten *.tif
mogrify -resize 1024x1234 -density 150x150 -colorspace gray -layers flatten *.tif

Wednesday, August 14, 2013

Matlab: split vector into number of parts of roughly the same size

%split into 3 parts
chunckCell=splitvect(1:10, 3);
chunckCell{:}
ans = 1 2 3 ans = 4 5 6 7 ans = 8 9 10