Skip to main content

OpenSesame Plug-in: Screenshot

An OpenSesame plug-in for saving screenshots of stimuli and other screens within an experiment.

Copyright (C) 2024-2026 Bob Rosbag

About

This plug-in saves screenshots of stimuli and other screens within an experiment.

The screenshots are saved in the folder of the log file, in a subfolder per capture method and subject, for example screenshots_stim_psycho/subject-1/filename.png.

This plug-in has the following options:

  • Verbose mode: print the path of each saved screenshot.
  • Stimulus display (PsychoPy): capture the PsychoPy window, saved in screenshots_stim_psycho. Only available with the PsychoPy backend.
  • Stimulus display (PIL): capture the first monitor with PIL, saved in screenshots_stim_pil.
  • Composite of all displays (PIL): capture all monitors with PIL, saved in screenshots_full_pil.
  • Filename: the filename with extension; the extension determines the picture format (.png, .jpg, etc.). Variables can be used, e.g. trial_[count_trial_sequence].png. The filename can't contain a folder.

Known issues

Which capture method works depends on the operating system and the display server. Check the screenshots of a test run before you rely on them.

System Stimulus display (PsychoPy) Stimulus display and composite (PIL)
Linux, X11 works (see below for the first screenshot) works
Linux, Wayland black images works
Windows works shows the desktop behind a fullscreen experiment, not the stimulus
  • Linux, X11, PsychoPy: the first screenshot of the experiment can be corrupt (dark, with a diagonal line). The plugin prevents this by reading the screen once when the first screenshot item is prepared, before the stimulus is shown. This doesn't help when the first screenshot item is prepared after its stimulus was shown, e.g. a screenshot item in a loop that directly follows the stimulus. Workaround: put a screenshot item with its own filename (e.g. dummy.png) at the start of the experiment, outside the trials, and ignore its screenshot.
  • Linux, Wayland, PsychoPy: all screenshots are black. Workaround: use the PIL options, or log in to an X11 session (e.g. "Ubuntu on Xorg").
  • Windows, PIL: the screenshots show the desktop behind the fullscreen experiment window. Workaround: use the PsychoPy option.
  • Without a graphics card (e.g. a virtual X server such as Xvfb, which uses Mesa's software renderer), PsychoPy screenshots are black too.

License

This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version (GPL-3.0-or-later).

The full license text is in the file COPYING, and is also available at https://www.gnu.org/licenses/gpl-3.0.html.

This plug-in contains works of others. Icons are derivatives of the Faenza icon theme.

Documentation

Installation instructions and documentation on OpenSesame are available on the documentation website:

Metadata

Release files for opensesame-plugin-screenshot 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opensesame-plugin-screenshot 0.8.2
File Size Uploaded Provenance Actions
opensesame_plugin_screenshot-0.8.2.tar.gz 20.4 kB Without provenance Details for opensesame_plugin_screenshot-0.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opensesame-plugin-screenshot 0.8.2
File Interpreter ABI Platform Actions
opensesame_plugin_screenshot-0.8.2-py3-none-any.whl Python 3 none any Details for opensesame_plugin_screenshot-0.8.2-py3-none-any.whl

Total release size: 42.9 kB

Release files / opensesame_plugin_screenshot-0.8.2.tar.gz

Download URL opensesame_plugin_screenshot-0.8.2.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
26877833269ba5997a151a4fbcad850352cd0d16fbdf95f81f81ea4a6df48815
BLAKE2b-256 checksum
How to use checksums
636309a931038d4aa06fd486b214ababa00fbed14c5f49ea0c6a3d0379476bcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / opensesame_plugin_screenshot-0.8.2-py3-none-any.whl

Download URL opensesame_plugin_screenshot-0.8.2-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47587728fe1265df60dc66e542bc7f8ce500544d16e9e42d1a4adbe3d5eea92a
BLAKE2b-256 checksum
How to use checksums
7ebc2dd4f5a2d49fad796ab9cb884a9efbab1879e2aa838069f501342b4041fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for opensesame-plugin-screenshot 0.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page