Gibts da irgendwo eine Kompatiblitätstabelle?
Du könntest höchstens versuchen dir die Release Notes/Changelogs zu Gemüte zu führen:
Zum Beispiel,
https://www.imagemagick.org/script/changelog.php
Aber dafür solltest du wissen welcher Befehl wie und warum fehlschlägt... was anderes wüsste ich auf die schnelle nicht.
PS: Kannst du mal ein Packen von den Scans (5-10), bunte Auswahl hochladen - ich würde mich gerne daran versuchen, da ich aktuell Zeit habe... wäre ganz nett.
Edit:
Wenn du dir Pillow und Python3 installieren kannst, mit allen Abhängigkeiten, kannst du ja mal das hier probieren, das funktioniert eigentlich (mit genau diesen Settings) ganz gut bei deinem Beispielbild:
[src=python]#!/usr/bin/python3
from glob import glob
from math import ceil
from PIL import Image
# READS FROM "input/files.jpg"
# SAVE TO "output/files.jpg"
inputList = glob("input/*.jpg")
#-------------------------------------------------------------------------------
# OPTIONS
borderSize = 5 # The amount of pixels which (should) define a border
maxSearchWidth = 120 # The max search in pixels of the edges
borderColor = (5, 5, 5) # Border color in RGB which is valid as border
borderColorVariantion = 3 # How many levels each pixel is allowed to differ from borderColor to be counted as borderpixel
tolerancePixels = 5 # Pixel tolerance from which border pixels can be apart (more seems to be required!)
space = 2; # The space minimum to be left from detected edges (can be negative)
estimationSteps = 100 # How many steps the image should be gone through in x and y
#-------------------------------------------------------------------------------
borderColorSum = sum(borderColor)
borderColorVariantion = borderColorVariantion * 3;
borderColorSumLow = borderColorSum - borderColorVariantion;
borderColorSumHigh = borderColorSum + borderColorVariantion;
for picture in inputList:
cordsTB = [];
cordsBT = [];
cordsLR = [];
cordsRL = [];
pic = Image.open(picture)
pixels = pic.load()
#print(pic.format, pic.size, pic.mode)
#pic.show()
testLR = ceil(pic.size[0] / estimationSteps)
testTB = ceil(pic.size[1] / estimationSteps)
#---------------------------------------------------------------------------
# RIGHT LEFT DETERMINATION
cordsTB = []
cordsBT = []
step = 0
for x in range(0, pic.size[0], testLR):
cordsTB.append([])
cordsBT.append([])
for y in range(0, maxSearchWidth):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsTB[step].append
for y in range(pic.size[1]-maxSearchWidth, pic.size[1]):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsBT[step].append
step += 1
#---------------------------------------------------------------------------
# LEFT-RIGHT DETERMINATION
cordsLR = []
cordsRL = []
step = 0
for y in range(0, pic.size[1], testTB):
cordsLR.append([])
cordsRL.append([])
for x in range(0, maxSearchWidth):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsLR[step].append(x)
for x in range(pic.size[0]-1, pic.size[0]-maxSearchWidth, -1):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsRL[step].append(x)
step += 1
#---------------------------------------------------------------------------
# CROPPING ESTIMATES
# TOP CROP
initialCoords = []
for coordinates in cordsTB:
try:
starting = coordinates[0]
currentSize = 1
for coord in coordinates[1:]:
if (coord - tolerancePixels) <= starting:
currentSize += 1
if currentSize == borderSize:
initialCoords.append(starting)
break;
else:
starting = coord
currentSize = 1
except:
pass
if len(initialCoords) != 0:
top = initialCoords[0]
for coord in initialCoords:
if coord < top:
top = coord
else:
top = 0
#---------------------------------------------------------------------------
# BOTTOM CROP
initialCoords = []
for coordinates in cordsBT:
try:
starting = coordinates[0]
currentSize = 1
for coord in coordinates[1:]:
if (coord - tolerancePixels) >= starting:
currentSize += 1
if currentSize == borderSize:
initialCoords.append(starting)
break;
else:
starting = coord
currentSize = 1
except:
pass
if len(initialCoords) != 0:
bottom = initialCoords[0]
for coord in initialCoords:
if coord > bottom:
bottom = coord
else:
bottom = pic.size[1]
#---------------------------------------------------------------------------
# LEFT CROP
initialCoords = []
for coordinates in cordsLR:
try:
starting = coordinates[0]
currentSize = 1
for coord in coordinates[1:]:
if (coord - tolerancePixels) >= starting:
currentSize += 1
if currentSize == borderSize:
initialCoords.append(starting)
break;
else:
starting = coord
currentSize = 1
except:
pass
if len(initialCoords) != 0:
left = initialCoords[0]
for coord in initialCoords:
if coord < left:
left = coord
else:
left = 0
#---------------------------------------------------------------------------
# RIGHT CROP
initialCoords = []
for coordinates in cordsRL:
try:
starting = coordinates[0]
currentSize = 1
for coord in coordinates[1:]:
if (coord - tolerancePixels) >= starting:
currentSize += 1
if currentSize == borderSize:
initialCoords.append(starting)
break;
else:
starting = coord
currentSize = 1
except:
pass
if len(initialCoords) != 0:
right = initialCoords[0]
for coord in initialCoords:
if coord > right:
right = coord
else:
right = pic.size[0]
# EDGE SPACING
if (left - space) >= 0:
left -= space
if (top - space) >= 0:
top -= space
if (right + space) <= pic.size[0]:
right += space
if (bottom + space) <= pic.size[1]:
bottom += space;
# CROPPED
pic = pic.crop((left, top, right, bottom))
# SAVE
pic.save("output/"+ picture.replace("input/", "", 1));
# SHOW
#pic.show()
[/src]