Dear all,
I read a lot on the forums before posting here but I cannot solve my issue, so I hope you can help me dealing with this matter:
I simply would like to remove black borders around my images produced from a digital camera which take pictures of ancient manuscripts.
This is my sample image: https://www.dropbox.com/s/imrs6unowxdte ... X.tif?dl=0
This is the command I am now using and it actually works!
convert IMGP2341DX.tif -bordercolor black -border 1 -fuzz 40% -fill black -draw "color 0,0 floodfill" -shave 1x1 prova.tiff
convert -fuzz 95% -trim prova.tiff fine.tiff
The problem arises when I se up a bash script to loop through the files, the command above does not give the same result.
This is my script: https://www.dropbox.com/s/3eug0mk761x8d ... ge.sh?dl=0
the problem seems to be the following line:
convert ${f} -monitor -bordercolor black -border 1 -fuzz 40% -fill black -draw "color 0,0 floodfill" -shave 1x1 shaved-tmp${f}
if I launch the script with bash -x I see that the command is launched as this:
convert IMGP2341DX.tif -bordercolor black -border 1 -fuzz 40% -fill black -draw 'color 0,0 floodfill' -shave 1x1 prova.tiff
instead of:
convert IMGP2341DX.tif -bordercolor black -border 1 -fuzz 40% -fill black -draw "color 0,0 floodfill" -shave 1x1 prova.tiff
What do you think?
Thanks a lot,
L.
Cropping black borders from manuscript
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Cropping black borders from manuscript
What version of IM are you using?
I notice the file IMGP2341DX.tif is encoded in AddobeRGB. That won't cause a problem to IM, but some viewers will ignore this and assume the image is sRGB.
What is different about the result? Please post the two versions of the image.toppah wrote:... the command above does not give the same result.
I notice the file IMGP2341DX.tif is encoded in AddobeRGB. That won't cause a problem to IM, but some viewers will ignore this and assume the image is sRGB.
snibgo's IM pages: im.snibgo.com