Jump to content

Image noise: Difference between revisions

improved python example from 10 to 23 fps
(more improvements! 140 FPS to 185 FPS!)
(improved python example from 10 to 23 fps)
Line 291:
{{libheader|PIL}}
 
Max 1023 FPS on Python 2.7 (r27:82525 MSC v.1500 32 bit Intel), Windows 7 64-bit on Athlon II X4 620 - ATI Radeon X1200.
 
<lang python>import Tkinter
Line 298:
import time
#colors = [(0,0,0),(255,255,255)]
size = (320,240)
pixels = size[0] * size[1]
Line 316:
def loop(self):
self.ta = time.time()
self.img.putdata([(255,255,255) if random.choicerandom(colors) > 0.5 else (0,0,0) for i in range(pixels)]) # translation of C# example, 13 FPS boost.
self.pimg = ImageTk.PhotoImage(self.img)
self.label["image"] = self.pimg
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.