Last Update: 16.01.2008. By kerim in python
Topic: Using python to determine (sub-)pixel errors in TFT monitors.
Buying tft monitors can be a very frustrating task. Most products adhere to the so called “class II”. There is a specification (ISO 13406-2) which tells us the amount of defects permissable for monitors. These defects are counted per million pixel. For a class 2 monitor this means that you can’t return your monitor as “defect” if it has less than or equal to:
Now how do you test that ? There is a nice tool for windows only called Dead Pixel Tester. It helps and offers some more features (which i don’t need). But why would I use that when i have my little Python ? I just coded some small tool (3kb size) that cycles through the important fullscreen color modes (black, white, red, blue, green). I wont say much about it as it should be obvious how it works. Which pixel defect you have (if any) can be easily determined by combining the results you get through the different color states.
#! /usr/bin/env python
import threading as th
import Tkinter,tkMessageBox
states=['black','white','red','blue','green']
introtext="""Hi and welcome to MCTU.
This program will cycle through 5 different colors while in fullscreen so you can check your TFT monitor.
Each pixel is made up of three transistors in your TFT (one for red, one for blue and one for green).
Any color can be represented through the combination of these three colors.
So defects can be determined by going through these three colors plus white and black.
Black means that all transistors should be deactivated.
If you see something then there is at least one transistor defect and allways on.
White means that all transistors should be activated.
If you see some pixel in a different color then it means that at least one transistor is defect and allways off.
Red means that only those transistors for red should be active.
If you see a different color then you know that at least one transistor is allways on/of and it is NOT the red one.
Blue means that only those transistors for blue should be active.
If you see a different color then you know that at least one transistor is allways on/of and it is NOT the blue one.
Green means that only those transistors for green should be active.
If you see a different color then you know that at least one transistor is allways on/of and it is NOT the gren one.
So basically you can determine any defect by combining the results of these 5 tests.
Go through the colors by pressing ANY key.
Exit this program at any time by using either the Escape key or Control-q
"""
class MCTU(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.state=-1
self.setFullScreen()
self.grid()
self.pane = Tkinter.Label(self, text=introtext,font=("Helvetica", 16),background='black', foreground='white')
self.pane.grid(column=0,row=0,sticky='EWNS')
self.grid_columnconfigure(0,weight=1)
self.grid_rowconfigure(0, weight=1)
self.bind("<Control-q>", self.OnQuit)
self.bind("<Key-Escape>", self.OnQuit)
self.bind("<Key>", self.OnKey)
def setFullScreen(self):
self.w,self.h=self.winfo_screenwidth(),self.winfo_screenheight()
self.overrideredirect(1)
self.geometry("%dx%d+0+0"%(self.w,self.h))
def OnQuit(self,event):
event.widget.quit()
def OnKey(self,event):
self.state+=1
if self.state>=len(states):
self.state=0
self.switchColorStates()
def switchColorStates(self):
if self.state<len(states):
self.pane.configure(text="",background=states[self.state])
if __name__ == "__main__":
app = MCTU(None)
app.title('MCTU - Monitor Calibration and Testing Utility')
app.mainloop()