The separate commands produce an output the is shifted to the right by about 100px, the all in one 'seems' to produce the 'correct' output. What have I missed?
By shifted to the right I mean the block of text on the page relative to the image edge. - it's a greyscale scan of a page of a book. Both output images are the same dimension...
Code: Select all
e.g.
[i]Working on 0037.tif
spine mark is 2847
image width is 2922
top mark (edge) is 240
img height is 3976
offset 75
[/i]
SET pageheight=3525
SET pagewidth=2380
convert %filenameext% -gravity northeast -crop %pagewidth%x%pageheight%+%offset%+%topmark% +repage .\done1\1_%filenameext%
convert .\done1\1_%filenameext% -background white -deskew 40%% -level 10%%,90%%,1 .\done1\2_%filenameext%
convert .\done1\2_%filenameext% -shave 40x40 .\done1\3_%filenameext%
convert .\done1\3_%filenameext% -background white -splice 100x100 -gravity center -crop %pagewidth%x%pageheight% +repage .\done1\4_%filenameext%
rem ----------------------
convert %filenameext% -gravity northeast -crop %pagewidth%x%pageheight%+%offset%+%topmark% +repage -background white -deskew 40%% -level 10%%,90%%,1 -shave 40x40 -background white -splice 100x100 -gravity center -crop %pagewidth%x%pageheight% +repage .\done1\5_%filenameext%