How to slice up image of text
Re: How to slice up image of text
Changing it to double quotes worked. It's going somewhere but then stalls again - any ideas on this?
c:\Images>rem From image pat_crp.png, guillotines into pieces.
guilFind: OFFSET=192
787,0,graya(0,1)
811,0,graya(0,1)
835,0,graya(0,1)
859,0,graya(0,1)
883,0,graya(0,1)
907,0,graya(0,1)
931,0,graya(0,1)
955,0,graya(0,1)
980,0,graya(0,1)
983,0,graya(0,1)
1027,0,graya(0,1)
1051,0,graya(0,1)
2011,0,graya(0,1)
2035,0,graya(0,1)
guilFind: nCUTS=14
979
1003
1027
1051
1075
1099
1123
1147
1172
1175
1219
1243
2203
2227
'identify' is not recognized as an internal or external command,
operable program or batch file.
'cPrefix' is not recognized as an internal or external command,
operable program or batch file.
convert c:\Images\pat_crp.png -rotate -90
( +clone -crop 980x+0+0 +repage -rotate 90 -write subs_0.png +delete )
( +clone -crop 24x+980+0 +repage -rotate 90 -write subs_1.png +delete )
( +clone -crop 24x+1004+0 +repage -rotate 90 -write subs_2.png +delete )
( +clone -crop 24x+1028+0 +repage -rotate 90 -write subs_3.png +delete )
( +clone -crop 24x+1052+0 +repage -rotate 90 -write subs_4.png +delete )
( +clone -crop 24x+1076+0 +repage -rotate 90 -write subs_5.png +delete )
( +clone -crop 24x+1100+0 +repage -rotate 90 -write subs_6.png +delete )
( +clone -crop 24x+1124+0 +repage -rotate 90 -write subs_7.png +delete )
( +clone -crop 25x+1148+0 +repage -rotate 90 -write subs_8.png +delete )
( +clone -crop 3x+1173+0 +repage -rotate 90 -write subs_9.png +delete )
( +clone -crop 44x+1176+0 +repage -rotate 90 -write subs_10.png +delete )
( +clone -crop 24x+1220+0 +repage -rotate 90 -write subs_11.png +delete )
( +clone -crop 960x+1244+0 +repage -rotate 90 -write subs_12.png +delete )
( +clone -crop 24x+2204+0 +repage -rotate 90 -write subs_13.png +delete )
( +clone -crop +2228+0 +repage -rotate 90 -write subs_14.png )
NULL:
c:\Images>rem From image pat_crp.png, guillotines into pieces.
guilFind: OFFSET=192
787,0,graya(0,1)
811,0,graya(0,1)
835,0,graya(0,1)
859,0,graya(0,1)
883,0,graya(0,1)
907,0,graya(0,1)
931,0,graya(0,1)
955,0,graya(0,1)
980,0,graya(0,1)
983,0,graya(0,1)
1027,0,graya(0,1)
1051,0,graya(0,1)
2011,0,graya(0,1)
2035,0,graya(0,1)
guilFind: nCUTS=14
979
1003
1027
1051
1075
1099
1123
1147
1172
1175
1219
1243
2203
2227
'identify' is not recognized as an internal or external command,
operable program or batch file.
'cPrefix' is not recognized as an internal or external command,
operable program or batch file.
convert c:\Images\pat_crp.png -rotate -90
( +clone -crop 980x+0+0 +repage -rotate 90 -write subs_0.png +delete )
( +clone -crop 24x+980+0 +repage -rotate 90 -write subs_1.png +delete )
( +clone -crop 24x+1004+0 +repage -rotate 90 -write subs_2.png +delete )
( +clone -crop 24x+1028+0 +repage -rotate 90 -write subs_3.png +delete )
( +clone -crop 24x+1052+0 +repage -rotate 90 -write subs_4.png +delete )
( +clone -crop 24x+1076+0 +repage -rotate 90 -write subs_5.png +delete )
( +clone -crop 24x+1100+0 +repage -rotate 90 -write subs_6.png +delete )
( +clone -crop 24x+1124+0 +repage -rotate 90 -write subs_7.png +delete )
( +clone -crop 25x+1148+0 +repage -rotate 90 -write subs_8.png +delete )
( +clone -crop 3x+1173+0 +repage -rotate 90 -write subs_9.png +delete )
( +clone -crop 44x+1176+0 +repage -rotate 90 -write subs_10.png +delete )
( +clone -crop 24x+1220+0 +repage -rotate 90 -write subs_11.png +delete )
( +clone -crop 960x+1244+0 +repage -rotate 90 -write subs_12.png +delete )
( +clone -crop 24x+2204+0 +repage -rotate 90 -write subs_13.png +delete )
( +clone -crop +2228+0 +repage -rotate 90 -write subs_14.png )
NULL:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to slice up image of text
If you are running IM 7, then you need to replace identify with magick identify
Re: How to slice up image of text
I found it - what about cPrefix? That's not a batch file that I have? I'll double check your site.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to slice up image of text
Bother, sorry, cPrefix.exe is an unpublished program. Here, it simply adds a "^" to the end of each line in the BAT file that has been created.
In guilChop.bat, replace this line:
... with these three lines:
In guilChop.bat, replace this line:
Code: Select all
cPrefix /p0 /i%SCR_FILE% /r"^"
Code: Select all
set SCR_FILE2=guilc_tmp2.bat
copy %SCR_FILE% %SCR_FILE2%
@( @for /F "tokens=*" %%L in (%SCR_FILE2%) do @echo %%L ^^) >%SCR_FILE%
snibgo's IM pages: im.snibgo.com
Re: How to slice up image of text
Getting even closer, it runs and leaves me with three png files. The issue now is that rather than getting strips like this:
it actually spits out the columns rather than the rows as above. I tried rotating it first but that didn't seem to make a difference. Any ideas?
it actually spits out the columns rather than the rows as above. I tried rotating it first but that didn't seem to make a difference. Any ideas?
Re: How to slice up image of text
I did some more pre-processing of the image and came up with strips. One more thing that if I can nail down will have this thing in the bag, it's cutting off the amount on the far right side, can you tell me why that might be? It usually cuts it off just after the comma (if it's thousands) or just before the number if it's hundreds. Is there a command I could edit about the right hand side cutoff because I can edit the image beforehand to have no margin on the right side.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to slice up image of text
Re horizontal or vertical: What command are you using to call guillotine.bat? Text at the top of the file describes the six parameters you can use.
I don't follow. Please provide samples.damonm wrote:... it's cutting off the amount on the far right side, can you tell me why that might be?
snibgo's IM pages: im.snibgo.com
Re: How to slice up image of text
In the example above that's blurred out, the last column is an amount. In the finished product, the amount is getting chopped off if it's less than $1,000. If it's more than $1,000 it leaves the $1 and the comma. Does that make sense?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to slice up image of text
If you are chopping horizontally, it shouldn't make any vertical chops.
snibgo's IM pages: im.snibgo.com
Re: How to slice up image of text
Hey again! I've decided not to worry too much about the amount due that is getting chopped off on the right hand side of each cut, but I have a couple of other questions: 1.) Is there a way to make this process loop through a batch of .jpg files (I need to 156 pages)? and 2.) Is there a way to change the output destination file to another folder?
Many thanks again for all your help, you have made something possible that I thought might be impossible!
Damon
Many thanks again for all your help, you have made something possible that I thought might be impossible!
Damon
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to slice up image of text
I assume you now have a script with parameters for input file and output file.
Write another script with a "for" loop, to loop through your JPEGs and calls that script once per JPEG. The output filename can contain a folder.
Write another script with a "for" loop, to loop through your JPEGs and calls that script once per JPEG. The output filename can contain a folder.
snibgo's IM pages: im.snibgo.com