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.
Split image to make 2 separate images from one (vert)
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Split image to make 2 separate images from one (vert)
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Split image to make 2 separate images from one (vert)
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.
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)
ok obtain info and left page,
anyone can help me to obtain right page ?
thank you,
m.
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
thank you,
m.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Split image to make 2 separate images from one (vert)
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.
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)
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Split image to make 2 separate images from one (vert)
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
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)
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.
read documentation but don't understand how use (i'm less smart than i think)
thank you again for support,
m.