Behavior Research Methods

, Volume 46, Issue 4, pp 913–921 | Cite as

PyGaze: An open-source, cross-platform toolbox for minimal-effort programming of eyetracking experiments

  • Edwin S. DalmaijerEmail author
  • Sebastiaan Mathôt
  • Stefan Van der Stigchel


The PyGaze toolbox is an open-source software package for Python, a high-level programming language. It is designed for creating eyetracking experiments in Python syntax with the least possible effort, and it offers programming ease and script readability without constraining functionality and flexibility. PyGaze can be used for visual and auditory stimulus presentation; for response collection via keyboard, mouse, joystick, and other external hardware; and for the online detection of eye movements using a custom algorithm. A wide range of eyetrackers of different brands (EyeLink, SMI, and Tobii systems) are supported. The novelty of PyGaze lies in providing an easy-to-use layer on top of the many different software libraries that are required for implementing eyetracking experiments. Essentially, PyGaze is a software bridge for eyetracking research.


Eyetracking Open-source Software Python PsychoPy Gaze contingency 


Author note

Many thanks to Richard Bethlehem for his help with testing, to Ignace Hooge for his advice on saccade detection, and to Daniel Schreij and Wouter Kruijne for their contributions to the EyeLink code. S.M. was funded by ERC Grant No. 230313 to Jonathan Grainger.


  1. Brainard, D. H. (1997). The Psychophysics Toolbox. Spatial Vision, 10, 433–436. doi: 10.1163/156856897X00357 PubMedCrossRefGoogle Scholar
  2. Cornelissen, F. W., Peters, E. M., & Palmer, J. (2002). The Eyelink Toolbox: Eye tracking with MATLAB and the Psychophysics Toolbox. Behavior Research Methods, Instruments, & Computers, 34, 613–617. doi: 10.3758/BF03195489 CrossRefGoogle Scholar
  3. Engbert, R., & Kliegl, R. (2003). Microsaccades uncover the orientation of covert attention. Vision Research, 43, 1035–1045. doi: 10.1016/S0042-6989(03)00084-1 PubMedCrossRefGoogle Scholar
  4. Forster, K. I., & Forster, J. C. (2003). DMDX: A Windows display program with millisecond accuracy. Behavior Research Methods, Instruments, & Computers, 35, 116–124. doi: 10.3758/BF03195503 CrossRefGoogle Scholar
  5. Free Software Foundation. (2007). GNU General Public License. The GNU General Public License v3.0 - GNU Project - Free Software Foundation (FSF). Retrieved July 28, 2013, from
  6. Hunter, J. D. (2007). Matplotlib: A 2D Graphics Environment. Computing in Science & Engineering, 9, 90–95. doi: 10.1109/MCSE.2007.55 CrossRefGoogle Scholar
  7. Krause, F., & Lindemann, O. (2013). Expyriment: A Python library for cognitive and neuroscientific experiments. Behavior Research Methods. doi: 10.3758/s13428-013-0390-6
  8. Lingnau, A., Schwarzbach, J., & Vorberg, D. (2008). Adaptive strategies for reading with a forced retinal location. Journal of Vision, 8(5):6, 1–18. doi: 10.1167/8.5.6 Google Scholar
  9. Lingnau, A., Schwarzbach, J., & Vorberg, D. (2010). (Un-)coupling gaze and attention outside central vision. Journal of Vision, 10(11), 13. doi: 10.1167/10.11.13 PubMedCrossRefGoogle Scholar
  10. Mathôt, S., Schreij, D., & Theeuwes, J. (2012). OpenSesame: An open-source, graphical experiment builder for the social sciences. Behavior Research Methods, 44, 314–324. doi: 10.3758/s13428-011-0168-7 PubMedCentralPubMedCrossRefGoogle Scholar
  11. Nyström, M., & Holmqvist, K. (2010). An adaptive algorithm for fixation, saccade, and glissade detection in eyetracking data. Behavior Research Methods, 42, 188–204. doi: 10.3758/BRM.42.1.188 PubMedCrossRefGoogle Scholar
  12. Oliphant, T. E. (2007). Python for Scientific Computing. Computing in Science & Engineering, 9, 10–20. doi: 10.1109/MCSE.2007.58 CrossRefGoogle Scholar
  13. Peirce, J. W. (2007). PsychoPy—Psychophysics software in Python. Journal of Neuroscience Methods, 162, 8–13. doi: 10.1016/j.jneumeth.2006.11.017 PubMedCentralPubMedCrossRefGoogle Scholar
  14. Peirce, J. W. (2009). Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2, 10. doi: 10.3389/neuro.11.010.2008
  15. San Agustin, J., Skovsgaard, H., Hansen, J. P., & Hansen, D. W. (2009). Low-cost gaze interaction: ready to deliver the promises. In Proceedings of the 27th international Conference Extended Abstracts on Human Factors in Computing Systems (pp. 4453–4458). New York, NY: ACM Press. doi: 10.1145/1520340.1520682 Google Scholar
  16. San Agustin, J., Skovsgaard, H., Mollenbach, E., Barret, M., Tall, M., Hansen, D. W., & Hansen, J. P. (2010). Evaluation of a low-cost open-source gaze tracker. In Proceedings of the 2010 Symposium on Eye-Tracking Research and Applications (pp. 77–80). New York, NY: ACM Press. doi: 10.1145/1743666.1743685 CrossRefGoogle Scholar
  17. Saunders, D. R., & Woods, R. L. (2013). Direct measurement of the system latency of gaze-contingent displays. Behavior Research Methods. doi: 10.3758/s13428-013-0375-5
  18. Schneider, W. (1988). Micro Experimental Laboratory: An integrated system for IBM PC compatibles. Behavior Research Methods, Instruments, & Computers, 20, 206–217. doi: 10.3758/BF03203833 CrossRefGoogle Scholar
  19. Sharika, K. M., Neggers, S. F. W., Gutteling, T. P., Van der Stigchel, S., Dijkerman, H. C., & Murthy, A. (2013). Proactive control of sequential saccades in the human supplementary eye field. Proceedings of the National Academy of Sciences, 110, E1311–E1320. doi: 10.1073/pnas.1210492110 CrossRefGoogle Scholar
  20. Sogo, H. (2013). GazeParser: an open-source and multiplatform library for low-cost eye tracking and analysis. Behavior Research Methods, 45, 684–695. doi: 10.3758/s13428-012-0286-x PubMedCentralPubMedCrossRefGoogle Scholar
  21. Stahl, C. (2006). Software for generating psychological experiments. Experimental Psychology, 53, 218–232. doi: 10.1027/1618-3169.53.3.218 PubMedCrossRefGoogle Scholar
  22. Straw, A. D. (2008). Vision Egg: An open-source library for realtime visual stimulus generation. Frontiers in Neuroinformatics, 2, 4. doi: 10.3389/neuro.11.004.2008 PubMedCentralPubMedCrossRefGoogle Scholar
  23. Van Rossum, G., & Drake, F. L. (2011). Python Language reference manual. Bristol, UK: Network Theory Ltd.Google Scholar
  24. Wilson, G., Aruliah, D. A., Brown, C. T., Chue Hong, N. P., Davis, M., Guy, R. T., . . . Wilson, P. (2012). Best practices for scientific computing. arXiv, 1210.0530v3. Retrieved January 20, 2013, from

Copyright information

© Psychonomic Society, Inc. 2013

Authors and Affiliations

  • Edwin S. Dalmaijer
    • 1
    • 3
    Email author
  • Sebastiaan Mathôt
    • 2
  • Stefan Van der Stigchel
    • 1
  1. 1.Experimental Psychology, Helmholtz InstituteUtrecht UniversityUtrechtThe Netherlands
  2. 2.Laboratoire de Psychologie CognitiveAix-Marseille Université & CNRSMarseilleFrance
  3. 3.Department of Experimental PsychologyUtrecht UniversityUtrechtNetherlands

Personalised recommendations