performance - How do I efficiently concatenate ImageMagick and convert commands to produce a no of images -
i have big big size image of dimensions 4000*4000. want carry out various operations on image :
convert a.jpg -crop 6x6@ +repage +adjoin tile_6_%d.jpg convert a.jpg -crop 9x9@ +repage +adjoin tile_9_%d.jpg convert a.jpg -crop 3x3@ +repage +adjoin tile_3_%d.jpg convert a.jpg -resize 120x120 thumbnail.jpg
thus creating batch of 36+81+9+1 = 127
i trying
convert a.jpg \ \( +clone -resize 66% -crop 6x6@ +repage +adjoin -write tile_6x6_%d.jpg +delete \) \ \( +clone -resize 33% -crop 3x3@ +repage +adjoin -write tile_3x3_%d.jpg +delete \) \ \( +clone -crop 9x9@ +repage +adjoin -write tile_9x9_%d.jpg +delete \) \ -density 150 -quality 50 -resize 120x120 thumbnail.jpg
but doesn't work desired way , produces 250 files. wrong here ? best way concatenate these commands ?
+delete
deletes last image in image sequence. want -delete 0--1
, means delete images 0 through -1, negatively indexed -1 refers last image in sequence.
to elaborate bit, each of -crop
commands creates several images, want make sure delete of them stack after writing them disk. when working complex convert command line this, way see going on image stack(s) @ point insert -write info:
.
Comments
Post a Comment