Hi, I wanted to split http://i.imgur.com/CWkj5dv.jpg into http://i.imgur.com/vFAFtqh.jpg.
I used the divide_vert script, however it splitted too much.
Reading the TO_DO list in the code I found that the minimun height is planned for a future version.
Can somebody help me?
Maybe the number could somehow be used as a separator?
Thanks
I'm using the latest version of IM. OS are Ubuntu and OS X.
Split text by paragraphs / white line
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Split text by paragraphs / white line
Latest version of v6 or v7? Please say exactly which version.tecya wrote:I'm using the latest version of IM.
What divide_vert script? Perhaps the one at http://www.imagemagick.org/Usage/scripts/divide_vert
The required results are obtained from:
Code: Select all
set guilMIN_GAP=20
call %PICTBAT%guillotine CWkj5dv.jpg chop_XX.png White 5 . 1
snibgo's IM pages: im.snibgo.com
Re: Split text by paragraphs / white line
Thanks, sadly It didn't work. I also spent 5 hours trying to customize the divide_vert script, but without success
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Split text by paragraphs / white line
This may be similar to what snibgo suggested. But consider blurring the text, then thresholding, average down to 1 column and then expand back to full size for viewing, then threshold again. This produces a black and white image. The white lines separate your paragraphs. You can then crop to 1 column and send that to txt: format as a list. Then find the locations of the centers of each white area. Then you can draw gray lines at those locations in your original image. Or you can crop your image at each black area to separate each paragraph as its own image and combine as you desire with gray around it.
Code: Select all
convert CWkj5dv.jpg -blur 13x65000 -auto-level -threshold 90% -scale 1x1754! -scale 1240x1754! -auto-level -threshold 90% CWkj5dv_bw.png