Answer the question
In order to leave comments, you need to log in
How to cut many images by coordinates?
I wonder how to automate the process of cutting many .tif images from one .tif image, if there are coordinates of the upper left corner of each of these images in a format, for example, excel or simply listed in a text document.
I'm going to use ImageMagick's convert -crop, and the question arises, how can I pass a lot of coordinates there instead of entering them manually?
All cut out images are the same size, square.
Answer the question
In order to leave comments, you need to log in
Write a bash script that will read your text document and call imageMagic:
IFS=','
while read i val; do
вызов imageMagic $i, $val #$i - первый размер $val - второй размер
done < input.txt
0,100
100,200
Obviously write a small script. On bash it is most likely possible to do this, but I would use Python.
He always helps me out where bash can't.
You can use both the PIL library and call convert for each image.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question