Skip to content

wieluk/argyll-gamma-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gamma Calibration Script with Photometer and ArgyllCMS

Calibrate your monitor's gamma using a photometer and ArgyllCMS to generate gamma correction tables compatible with Psychtoolbox.

Prerequisites

1. Install ArgyllCMS

Ubuntu:

sudo apt-get install argyll

Other OS:

Download from ArgyllCMS Installation Guide.

2. Verify Installation

Ensure ArgyllCMS is in your PATH:

dispwin -?

3. Install Python Packages

With Python 3 installed:

pip3 install numpy scipy matplotlib

Running the Script

  1. Start the Script
python3 photometer_gamma_table.py
  1. Follow Prompts

    • Enter Base Name: e.g., calibration_session1.
    • Select Display Device: Choose from listed options.
    • Set Number of Patches:
      • Grayscale patches (e.g., 64, or 0 to skip).
      • Color patches per channel (e.g., 64, or 0 to skip).
      • At least one must be greater than zero.
  2. Calibrate the Photometer (for colormunki photo)

    1. Calibration Mode:
    • Place the photometer sensor face down, button facing you.
    • Set to calibration mode (bottom-left position).
  3. Switch to Measurement Mode

    • Set to measurement mode (bottom-middle position).
  4. Measure Test Patches

    • Follow on-screen instructions.
    • Position sensor against the monitor.
  5. Complete Calibration

    • Wait for processing to finish.
    • Files saved in a directory named after your base name and display number.

Using Gamma Tables in Psychtoolbox

Example MATLAB/Octave code:

% Load gamma table
gammaTable = load('path_to_gamma_table.txt');

% Open window
screenNumber = max(Screen('Screens'));
[windowPtr, ~] = Screen('OpenWindow', screenNumber);

% Apply gamma table
[oldTable, success] = Screen('LoadNormalizedGammaTable', windowPtr, gammaTable);

% Check success
if success
    disp('Gamma table loaded successfully.');
else
    disp('Failed to load gamma table.');
end

% ... Your experiment code ...

% Restore original gamma table
Screen('LoadNormalizedGammaTable', windowPtr, oldTable);
Screen('CloseAll');

Refer to Psychtoolbox documentation for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published