newbie1 wrote:How do i use your multicrop script with cgywin and imagemagick?
and for your suggestions to -scale to average the image down to 1 row, how do i do that ?
i tried using -scale 1000% example.jpg and this only make the whole image bigger
sorry for all these question as im really new into this kind of programming
I am not a windows user, so can only go by the fact that other users have installed cygwin and used my scripts.
See
http://www.imagemagick.org/Usage/windows/
With regard to -scale, you want to scale to 1 row which is -scale x1!. The width is left unchanged and height is made exactly 1, so you get one row. see
http://www.imagemagick.org/script/comma ... p#geometry
Try this on your image (-fuzz is needed as you have jpg input):
NOTE: the following is
unix. You may or may not have grep on windows (which just prints those lines containing white)??? But in windows you need to escape the % as %% and probably put double quotes around "x1!". Likewise the other commands further down. See the link above for further differences.
convert et61lk.jpg -fuzz 10% -trim -write et61lk_trim.png -scale x1! txt: | grep "white"
210,0: (255,255,255) #FFFFFF white
211,0: (255,255,255) #FFFFFF white
212,0: (255,255,255) #FFFFFF white
213,0: (255,255,255) #FFFFFF white
214,0: (255,255,255) #FFFFFF white
215,0: (255,255,255) #FFFFFF white
216,0: (255,255,255) #FFFFFF white
217,0: (255,255,255) #FFFFFF white
218,0: (255,255,255) #FFFFFF white
219,0: (255,255,255) #FFFFFF white
220,0: (255,255,255) #FFFFFF white
221,0: (255,255,255) #FFFFFF white
222,0: (255,255,255) #FFFFFF white
223,0: (255,255,255) #FFFFFF white
224,0: (255,255,255) #FFFFFF white
227,0: (255,255,255) #FFFFFF white
# trimmed image (et61lk_trim.png)
# get trimmed size
convert et61lk_trim.png -format "%wx%h" info:
400x329
# crop and trim
convert et61lk_trim.png -crop 209x329+0+0 -fuzz 10% -trim +repage et61lk_left.png
convert et61lk_trim.png -crop $((400-227))x336+227+0 -fuzz 10% -trim +repage et61lk_right.png
Actually you don't have to be very specific about what point in the white range to use. Lets just pick any one value, say 215.
convert et61lk_trim.png -crop 215x329+0+0 -fuzz 10% -trim +repage et61lk_left.png
convert et61lk_trim.png -crop $((400-215))x336+215+0 -fuzz 10% -trim +repage et61lk_right.png
And because of the trim, you get the same result