Page 1 of 1
Split image to make 2 separate images from one (vert)
Posted: 2011-03-06T15:28:25-07:00
by myspacee
Hello, Windows suer here,
read about splitting images and have a question.
I've a system that load a lot of pages. Sometimes one page is langer than others.
I need to detect weight, and when i find that page is langer than x, cut in half vertically.
One image for left part and one for right part.
post original large image :
http://static.repubblica.it/laprovincia ... /large.jpg
and its preview :
thank you for any help,
m.
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-06T16:48:22-07:00
by anthony
for 'if image is large than X' part you will need to use a script (DOS, PHP, Perl, Shell, etc) to make the test.
If X is also your tile crop size, then you can 'just do it' as an image smaller than that size that is tile cropped will not be modified. That is you get one tile of the original image.
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-07T04:13:22-07:00
by myspacee
thank you for reply,
as windows user think about dos batch.
Find a lot of post related to method to obtain information about an image (weight and height)
to start in right direction can you suggest me best method ?
(need only weight and height info to put in easy way in variable)
thank you,
m.
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-07T09:53:45-07:00
by myspacee
ok obtain info and left page,
Code: Select all
identify -format "%%w" test.jpg > w.txt
identify -format "%%h" test.jpg > h.txt
set /p Weight=< w.txt
set /p height=< h.txt
set /A half_Weight=%Weight%/2
set /A half_height=%height%/2
echo %Weight% = %half_Weight%
echo %height% = %half_height%
convert test.jpg -repage %half_Weight%x%height% sx.gif
anyone can help me to obtain right page ?
thank you,
m.
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-07T10:23:24-07:00
by fmw42
try this:
convert small.jpg -crop 50x100% +repage small_%d.jpg
see
http://www.imagemagick.org/Usage/crop/#crop and all the crop sections that follow.
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-07T10:46:14-07:00
by myspacee
ok, working to slice image in 2 identical part. (same size)
is there anyway to place 'cutter' where i want ?
i've all info i need (weight and height), or i need other information ?
I want to be able to put 'cutter' where i need...
thank you,
m.
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-07T15:12:58-07:00
by fmw42
Did you read the page I referenced? All you need to do is specify a different width in percent or pixels (for the left side).
convert small.jpg -crop 63x100% +repage small_%d.jpg
or
convert small.jpg -crop 200x240 +repage small_%d.jpg
Re: Split image to make 2 separate images from one (vert)
Posted: 2011-03-08T02:45:34-07:00
by myspacee
thank you for reply,
read
documentation but don't understand how use (i'm less smart than i think)
thank you again for support,
m.