Multple crops, multiple composites
Posted: 2009-02-05T03:43:50-07:00
Hi all, new here
Some great info on here, but is there a search function for the forum?
I have used imagemagick for a few years now and it has been extremely useful.
My current problem is one of speed.
I have a form, from which some regions are cropped out.
These regions are processed with another peice of software (to dilate, and erode, and some noise removal)
Then I have to put the now processed cropped sections back onto the orginal image.
Using Winxp here is the relevent part of the script:
%1 is the path, %2 is the image file name(document number), T1 and T2 are just temp files.
This works, and there 8 crops for the rear image (%~2_2) so in total this takes a while I guess due to the many disk ops.
Is there some way to have Imagemagick read the image once and perform many crops, and subsequently read all the cropped areas and write them out to a file once?
Thanks all
Some great info on here, but is there a search function for the forum?
I have used imagemagick for a few years now and it has been extremely useful.
My current problem is one of speed.
I have a form, from which some regions are cropped out.
These regions are processed with another peice of software (to dilate, and erode, and some noise removal)
Then I have to put the now processed cropped sections back onto the orginal image.
Using Winxp here is the relevent part of the script:
%1 is the path, %2 is the image file name(document number), T1 and T2 are just temp files.
Code: Select all
convert "%~2_1.tif" -crop "165x375+85+1350" "%~1\Q1.tif"
convert "%~2_1.tif" -crop "165x605+85+2370" "%~1\Q2.tif"
convert "%~2_1.tif" -crop "165x865+1285+960" "%~1\Q3.tif"
convert "%~2_1.tif" -crop "165x425+1285+2400" "%~1\Q4.tif"
convert "%~2_1.tif" -crop "165x400+1285+2975" "%~1\Q5.tif"
composite -geometry +85+1350 "%~1\Q1.tif" "%~2_1.tif" "%~1\T1.tif"
composite -geometry +85+2370 "%~1\Q2.tif" "%~1\T1.tif" "%~1\T2.tif"
composite -geometry +1285+960 "%~1\Q3.tif" "%~1\T2.tif" "%~1\T1.tif"
composite -geometry +1285+2400 "%~1\Q4.tif" "%~1\T1.tif" "%~1\T2.tif"
composite -geometry +1285+2975 "%~1\Q5.tif" "%~1\T2.tif" "%~1\T1.tif"
convert "%~1\T1.tif" -compress group4 -define quantum:polarity=min-is-white "%~2_1.tif"
Is there some way to have Imagemagick read the image once and perform many crops, and subsequently read all the cropped areas and write them out to a file once?
Thanks all