import numpy as np from numpy.linalg import inv from PIL import Image #------------------------------------------ # """ Iterative UniWB-Einstellung """ # LP=1366 # Horizontale Ausdehnung des Bildes [pix] BP=768 # Vertikale Ausdehnung des Bildes [pix] Gam=2.0 # Gamma-Wert des Monitors Ga=1./Gam loop=True # r=float(input('R ---> ')) g=float(input('G ---> ')) b=float(input('B ---> ')) # while loop: print() kr=float(input('Kr ---> ')) kb=float(input('Kb ---> ')) # if kr < 0. or kb < 0. : break # r=int(r*kr**Ga) g=int(g) b=int(b*kb**Ga) # print("R: %3.0f"%r, "G: %3.0f"%g, "B: %3.0f"%b) print() # if r > 255 or b > 255 or g > 255: print(" Fehler: RGB > 255") print(" Neuen Lauf mit kleineren Anfangswerten starten oder") print(" RBG Werte mit Faktor < 1 multiplizieren und ") print(" neustarten") break Bild="RGB_"+"%3.0f"%r+"_%3.0f"%g+"_%3.0f"%b+".jpg" im=Image.new('RGB',(LP,BP),'black') im=Image.new('RGB',(LP,BP),color=(r,g,b)) # dots=im.load() # for i in range(0,LP): # for j in range(0,BP): # dots[i,j]=(r,g,b) im.save(Bild,quality=100) # im.show()