• Hallo liebe Userinnen und User,

    nach bereits längeren Planungen und Vorbereitungen sind wir nun von vBulletin auf Xenforo umgestiegen. Die Umstellung musste leider aufgrund der Serverprobleme der letzten Tage notgedrungen vorverlegt werden. Das neue Forum ist soweit voll funktionsfähig, allerdings sind noch nicht alle der gewohnten Funktionen vorhanden. Nach Möglichkeit werden wir sie in den nächsten Wochen nachrüsten. Dafür sollte es nun einige der Probleme lösen, die wir in den letzten Tagen, Wochen und Monaten hatten. Auch der Server ist nun potenter als bei unserem alten Hoster, wodurch wir nun langfristig den Tank mit Bytes vollgetankt haben.

    Anfangs mag die neue Boardsoftware etwas ungewohnt sein, aber man findet sich recht schnell ein. Wir wissen, dass ihr alle Gewohnheitstiere seid, aber gebt dem neuen Board eine Chance.
    Sollte etwas der neuen oder auch gewohnten Funktionen unklar sein, könnt ihr den "Wo issn da der Button zu"-Thread im Feedback nutzen. Bugs meldet ihr bitte im Bugtracker, es wird sicher welche geben die uns noch nicht aufgefallen sind. Ich werde das dann versuchen, halbwegs im Startbeitrag übersichtlich zu halten, was an Arbeit noch aussteht.

    Neu ist, dass die Boardsoftware deutlich besser für Mobiltelefone und diverse Endgeräte geeignet ist und nun auch im mobilen Style alle Funktionen verfügbar sind. Am Desktop findet ihr oben rechts sowohl den Umschalter zwischen hellem und dunklem Style. Am Handy ist der Hell-/Dunkelschalter am Ende der Seite. Damit sollte zukünftig jeder sein Board so konfigurieren können, wie es ihm am liebsten ist.


    Die restlichen Funktionen sollten eigentlich soweit wie gewohnt funktionieren. Einfach mal ein wenig damit spielen oder bei Unklarheiten im Thread nachfragen. Viel Spaß im ngb 2.0.

Bilder(scans?) überwiegend einfarbige Ränder entfernen

theSplit

1998
Veteran Barkeeper

Registriert
3 Aug. 2014
Beiträge
28.562
Teste das mal mit dem Bild das du hier reingestellt hast, ich sehe da sehr wohl einen Unterschied ob es 32 oder 256 Farben (Graustufen) sind - in Gimp kann man über "Bild" > "Modus" > "Indexiert" -> konvertieren auf X Farben.

Gerade an den "Sprechblasen" ganz unteres Bild - die "Sonnenform" - da wo es hellgraue Farben gibt, durch den Scan. Du reduzierst dir die Hölle aus den Dingern und wirst dich schwarz und weiß (2 Farbig) ärgern...

Sei nicht so knauserig und tu dir was gutes und speichere es als 8 Bit PNG ab. ;)

Edit:

Ich habe übrigens meine Lösung jetzt angepasst:

Ergebniss des Autocroppings:




[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 = 3 # 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 = 15 # How many levels each pixel is allowed to differ from borderColor to be counted as borderpixel
tolerancePixels = 2 # Pixel tolerance from which border pixels can be apart (more seems to be required!)
space = 6; # 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]-1, 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(y)

for y in range(pic.size[1]-1, pic.size[1]-maxSearchWidth, -1):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsBT[step].append(y)

step += 1


#---------------------------------------------------------------------------
# LEFT-RIGHT DETERMINATION
cordsLR = []
cordsRL = []
step = 0

for y in range(0, pic.size[1]-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]
 
Zuletzt bearbeitet:

alter_Bekannter

N.A.C.J.A.C.

Registriert
14 Juli 2013
Beiträge
4.823
Ort
Midgard
  • Thread Starter Thread Starter
  • #22
Bidde:
sample16.gif

Sieht gut aus find ich.
Jetzt hätte ich gerne den Weg die gewählte Farbpallette zu exportieren füpr den Batchconvert.
Edit:
Bin nicht kauserig, ich sagte doch mehr als 16 Farben kann das Zieldisplay eh nicht. Das ist mein ersnt, ist E-Ink.
Daher folge ich dem Grundsatz dem "dummen" Gerät möglichst wenig zuzumuten.
 
Zuletzt bearbeitet:

theSplit

1998
Veteran Barkeeper

Registriert
3 Aug. 2014
Beiträge
28.562
Schaust du hier:

Hab dir eine Option eingebaut:
[src=python]
paletteFile = "sample16.gif" # GIF, JPG, PNG
[/src]

Diese definierte Palette wird für alle Vorgänge verwendet:

[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") # ONLY JPEG! - PNGs are not tested

#-------------------------------------------------------------------------------
# OPTIONS
paletteFile = "sample16.gif" # GIF, JPG, PNG
borderSize = 3 # 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 = 15 # How many levels each pixel is allowed to differ from borderColor to be counted as borderpixel
tolerancePixels = 2 # Pixel tolerance from which border pixels can be apart (more seems to be required!)
space = 6; # 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;

if len(paletteFile) != 0:
paletteSrc = Image.open(paletteFile)
else:
paletteSrc = None

for picture in inputList:
cordsTB = [];
cordsBT = [];
cordsLR = [];
cordsRL = [];

pic = Image.open(picture)
if paletteSrc:
pic.quantize(palette=paletteSrc)
#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]-1, 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(y)

for y in range(pic.size[1]-1, pic.size[1]-maxSearchWidth, -1):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsBT[step].append(y)

step += 1


#---------------------------------------------------------------------------
# LEFT-RIGHT DETERMINATION
cordsLR = []
cordsRL = []
step = 0

for y in range(0, pic.size[1]-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]


Deine Beispiele sehen jetzt so aus:
-


Vielleicht testest du das einfach mal ;)
 

alter_Bekannter

N.A.C.J.A.C.

Registriert
14 Juli 2013
Beiträge
4.823
Ort
Midgard
  • Thread Starter Thread Starter
  • #24
im ordner liegt das script.

Eine Ordner namens input mit den jpgs und die sample.

Was ist an dem Setup falsch, so hatte ich den Sourcode jetzt intepretiert oder steht da noch irgendwo eine andere Pfadangabe?



Man muss die Datei schon vorher speichern.

Edit:
ImportError: No module named 'PIL'
Was das jetzt exakt bedeutet war so ohne weiteres nicht zu ermitteln(denn der import der es laut stackoverflow sein soll ist so wie es aussieht ja drin) und blindlings Pakete installieren fange ich nicht an.

Oder konkreter:
apt-cache search PIL python pillow
python-pil - Python-Bildbearbeitungsbibliothek (Pillow-Fork)
python-pil.imagetk - Python Imaging Library - ImageTk Module (Pillow fork)
python-sane - Python Imaging Library - SANE interface (Pillow fork)
python3-pil - Python Imaging Library (Python3)

Warum fork? Ist Das kompatibel?

Außerdem scheint da noch die Konvertierung zu fehlen. Automatisch schneiden kann autotrim schon.

edit3:
Hab den Fehler gefunden der die Dateien vergrößert oder zumindest ein Teil davon.

Die Bilder werden hochskaliert/gestreckt um nach dme schneiden die selbe Auflösung zu haben, das ist quatsch, wie bekomme ich das weg?

Quatsch,, ich hab auf die falschen Dateien geguckt.
 
Zuletzt bearbeitet:

theSplit

1998
Veteran Barkeeper

Registriert
3 Aug. 2014
Beiträge
28.562
Die "sample16.gif" muß mit in den Skript Hauptordner, oder du gibst den Pfad mit an: "input/sample16.gif".

Der Ordner "output" muß auch angelegt werden.

Dann solltest es eigentlich alles funktionieren. :)

Edit:

Pillow ist ein "etwas" besserer Fork der auf PIL aufgebaut hat und ist eigentlich DER Ersatz für PIL.
Einige Features die Pillow mitbringt, hat PIL zum Beispiel überhaupt nicht.

Entweder du installierst dir "pip3" und installiert mittels "pip3 install pillow" - nur gestern war der Python Package Index absolut lahm bei mir und der Download über Pip3 schlug immer fehl (Timeout beim Download) - daher hatte ich es aus der Quelle von Github gebaut. Sollte eigentlich auch ohne Probleme gehen.... irgendwelche neuen Features hatte ich nicht benutzt. - Oder du brauchst die Buildchain, aber das sollte wollte der letzte Weg sein. :)

Wenn du Pillow installiert hast, wird es trotzdem über "from PIL import Image" aufgerufen (das nutzt dann trotzdem Pillow und hat nichts mit PIL gemeint), ist um Skripte zwischen den beiden noch irgendwo "kompatibel" zu halten.


Edit2:

Habe gerade gesehen, deine Palette hat keine Auswirkung bei JPGs... aber ich hab dir dafür einen Quality Switch eingebaut:

[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") # ONLY JPEG! - PNGs are not tested

#-------------------------------------------------------------------------------
# OPTIONS
paletteFile = "sample16.gif" # GIF, PNG output - sample file (located in script folder if no path is provided)
outputFormat = "jpg" # JPG, PNG, GIF, BMP, TIFF
imgQuality = 0 #60 # For JPG imgQuality for saving files, 0 means no quality settings (use original), default should be around 60 to 75
borderSize = 3 # 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 = 15 # How many levels each pixel is allowed to differ from borderColor to be counted as borderpixel
tolerancePixels = 2 # Pixel tolerance from which border pixels can be apart (more seems to be required!)
space = 6; # The space minimum to be left from detected edges (can be negative)
estimationSteps = 200 # 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;

if len(paletteFile) != 0:
paletteSrc = Image.open(paletteFile)
else:
paletteSrc = None

for picture in inputList:
cordsTB = [];
cordsBT = [];
cordsLR = [];
cordsRL = [];

pic = Image.open(picture)
#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]-1, 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(y)

for y in range(pic.size[1]-1, pic.size[1]-maxSearchWidth, -1):
pixelValue = sum(pic.getpixel((x,y)));
if pixelValue >= borderColorSumLow and pixelValue <= borderColorSumHigh:
cordsBT[step].append(y)

step += 1


#---------------------------------------------------------------------------
# LEFT-RIGHT DETERMINATION
cordsLR = []
cordsRL = []
step = 0

for y in range(0, pic.size[1]-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
if outputFormat == "jpg" or outputFormat == "jpeg":
if imgQuality != 0:
pic.save("output/"+ picture.replace("input/", "", 1).rstrip("jpeg")+outputFormat, optimize=True, progressive=True, quality=imgQuality);
else:
pic.save("output/"+ picture.replace("input/", "", 1).rstrip("jpeg")+outputFormat, optimize=True, progressive=True);
else if outputFormat == "gif":
if (paletteFile != ""):
pic = pic.quantize(palette=paletteSrc)

pic.save("output/"+ picture.replace("input/", "", 1).rstrip("jpeg")+outputFormat);
else if outputFormat == "png":
if (paletteFile != ""):
pic = pic.quantize(palette=paletteSrc)

pic.save("output/"+ picture.replace("input/", "", 1).rstrip("jpeg")+outputFormat, optimize=True);
else:
pic.save("output/"+ picture.replace("input/", "", 1).rstrip("jpeg")+outputFormat);



# SHOW
#pic.show()
[/src]
 
Zuletzt bearbeitet:

alter_Bekannter

N.A.C.J.A.C.

Registriert
14 Juli 2013
Beiträge
4.823
Ort
Midgard
  • Thread Starter Thread Starter
  • #26
Gibst das auch für stable?

Falls dem nicht so wäre bräuchte ich dafür eine VM und dafür habe ich gerade keine Lust.
 
Zuletzt bearbeitet:

theSplit

1998
Veteran Barkeeper

Registriert
3 Aug. 2014
Beiträge
28.562
Naja, es ist eine Python Bilbiothek/Erweiterung die du über "pip3" (gibt es als Paket, auch für Stable) aus dem Python Package Index installieren kannst, alles offiziell.

Als Paket über "apt" oder ähnlichem direkt gibt es das nicht, das wäre auch bei der Anzahl der Python Module wohl schier unmöglich. :)
 

alter_Bekannter

N.A.C.J.A.C.

Registriert
14 Juli 2013
Beiträge
4.823
Ort
Midgard
  • Thread Starter Thread Starter
  • #28
Dann führt wohl nichts daran vorbei den Installationsfehler zu posten:
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-kf6gjbgg/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-h4ny0jn8-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-kf6gjbgg/pillow
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 295, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 707, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/usr/lib/python3/dist-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-kf6gjbgg/pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-h4ny0jn8-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-kf6gjbgg/pillow

Direkt aus der angegebenen Log Datei.
 

theSplit

1998
Veteran Barkeeper

Registriert
3 Aug. 2014
Beiträge
28.562
Versuch mal bitte "pip3 install setuptools" zu installieren bzw. auch "pip3 install --upgrade setuptools" und dann nochmal "pillow".

Also, an Setuptools kann es liegen, aber auch folgendes, erhalte ich, das ist der wichtige Teil:

http://pillow.readthedocs.io/en/latest/installation.html#external-libraries

Many of Pillow’s features require external libraries:

*libjpeg provides JPEG functionality.
Pillow has been tested with libjpeg versions 6b, 8, 9, 9a, and 9b and libjpeg-turbo version 8.
Starting with Pillow 3.0.0, libjpeg is required by default, but may be disabled with the --disable-jpeg flag.
*zlib provides access to compressed PNGs
Starting with Pillow 3.0.0, zlib is required by default, but may be disabled with the --disable-zlib flag.
*libtiff provides compressed TIFF functionality
Pillow has been tested with libtiff versions 3.x and 4.0
*libfreetype provides type related services
*littlecms provides color management
Pillow version 2.2.1 and below uses liblcms1, Pillow 2.3.0 and above uses liblcms2. Tested with 1.19 and 2.7.
*libwebp provides the WebP format.
Pillow has been tested with version 0.1.3, which does not read transparent WebP files. Versions 0.3.0 and above support transparency.
*tcl/tk provides support for tkinter bitmap and photo images.

*openjpeg provides JPEG 2000 functionality.
Pillow has been tested with openjpeg 2.0.0 and 2.1.0.
Pillow does not support the earlier 1.5 series which ships with Ubuntu <= 14.04 and Debian Jessie.

*libimagequant provides improved color quantization
Pillow has been tested with libimagequant 2.6.0
Libimagequant is licensed GPLv3, which is more restrictive than the Pillow license, therefore we will not be distributing binaries with libimagequant support enabled.
Windows support: Libimagequant requires VS2013/MSVC 18 to compile, so it is unlikely to work with any Python prior to 3.5 on Windows.

Once you have installed the prerequisites, run:

$ pip install Pillow

In deinem Fall natürlich "pip3 install pillow".
 
Zuletzt bearbeitet:
Oben