Adjust the white point, gamma or make your XDR display darker without losing HDR peak luminance or the ability to adjust display brightness

Overview

XDR Tuner

Adjust the white point, gamma or make your XDR display darker without losing HDR peak luminance or the ability to adjust display brightness

Project: https://github.com/supercurio/xdr-tuner

Purpose

On the 2021 MacBook Pro M1 Pro & M1 Max running macOS Monterey 12.0.1, the "Apple XDR Display (P3-1600 nits)" and "Apple Display (P3-500 nits)" presets calibration cannot be "fine-tuned" in the display settings.

At the same time, calibrating the display using a sensor with X-Rite i1Profiler clips all the colors above SDR levels to SDR maximums, preventing the system to show HDR content.

However, there is a variation in the factory calibration between units, and the white point on yours might not perceptually matching the D65 spec, nor your other calibrated displays.

XDR Tuner lifts all the restrictions of the display presets by leveraging the support of full dynamic range max and gamma parameters for red/green/blue channels in ColorSync ICC profiles vcgt tag.

This allows to change the display's white point freely without limiting losing HDR support, limiting HDR peak brightness to full-screen luminance, losing the ability to adjust brightness or introducing banding artifacts.

Usage

This is script, it will need to be launched in a terminal like in the Terminal application.
Once your command shell is in this directory, you will be able to launch the script with the following commands.

Launch with default settings and sample configuration

./xdr-tuner.py

This will create a custom profile based on your system-generated one for your display, and apply it immediately.

Customize config and apply automatically

./xdr-tuner.py --loop

Then modify configs/default.json in any text editor until you get the desired color presentation.
Typically, you can open a white page or image and color-match the white point of the XDR display visually with a reference monitor.

Once finished, interrupt xdr-tuner with ctrl-c.

I would only like to lower the minimum brightness

./xdr-tuner.py --config configs/dim.json

If you find the display still too bright at the minimum brightness allowed by the system, applying the dark config will allow to make it darker. By changing the values for red, green and blue in the max section, you can make the display as dark as you'd like.

Changing the gamma to values lower than 1 might help with legibility when the screen is very dim.

Reset to factory profile

./xdr-tuner.py --reset

Set and apply an existing ICC profile

./xdr-tuner.py -a path/to/your-profile.icc

Print help

./xdr-tuner.py --help

Compatible with TrueTone and Night Shift

Both functionalities will work as expected, using your tuned display profile as reference, with no difference compared to factory calibration.

Limitations & TODO

  • This utility was not tested yet with multiple displays connected.
    Support will be added in a future version.
  • The profiles are not re-applied automatically at boot at the moment.
    Coming in a next version - stay tuned for updates
  • Switching between presets in Display Preferences resets the tuning, which needs to be re-applied manually. It looks like a bug in macOS color management, which should re-apply the current profile by itself.
    I don't know how to fix this currently.
  • No GUI: someone experienced with macOS gui app development is welcome to contribute a gui for this, or use this script as a mean to generate and apply the profiles. The license is liberal so maybe you will create your own utility inspired by this. Would appreciate a mention and shout out!
  • Ultimately, I think Apple should provide this capability out of the box in a system update. Hopefully, various display calibration software will gain full HDR support. This is still very new.
  • Better error management needs to be implemented

Bugs and issues

Please report any issue encountered in the dedicated section on Github.

This will help me or contributors to improve this software.

Story behind this

After recently receiving my 2021 MacBook Pro 16.2, I was happy with the device overall but really bummed that its display had too much blue and green, giving a greyish-green tint to all content displays.

Exploring the tuning option offered and trying i1Profiler led to unsatisfactory results as I didn't want to give up on 1600-nits HDR peak brightness nor the ability to adjust display brightness, including automatically with the light sensor.

My options were to return it, wait 2 months for a new custom order to be fulfilled and hope for the best on the new factory calibration, or give it for repair, giving up the ability to return it later and with unknown results.

So I decided to use all this frustration as motivation and leveraged my experience with display calibration and development.

And I'm very happy with the results :D

This solves all the problems I had with color matching displays.
Tuning is also a lot easier than by setting Yxy coordinates in Apple's solution, which is currently not very useful as the popular colorimeter sensors are lacking corrections matrices for the new type of phosphors the Liquid Retina XDR display are using.
Very few people can access a high resolution spectrophotometer that which is required to do a real D65 and colorspace calibration on this panel otherwise.
I tested my old i1Pro, its results are worthless with all the illuminant observer types known.

Credits

Thanks to Timothy Sutton with customdisplayprofiles and Chromium authors with color_profile_manager_mac.py for the inspiration and sample code.

Author

François Simond (supercurio)
https://twitter.com/supercurio

You might also like...
An assistant to guess your pip dependencies from your code, without using a requirements file.

Pip Sala Bim is an assistant to guess your pip dependencies from your code, without using a requirements file. Pip Sala Bim will tell you which packag

Its a simple and fun to use application. You can make your own quizes and send the lik of the quiz to your friends.
Its a simple and fun to use application. You can make your own quizes and send the lik of the quiz to your friends.

Quiz Application Its a simple and fun to use application. You can make your own quizes and send the lik of the quiz to your friends. When they would a

An addin for Autodesk Fusion 360 that lets you view your design in a Looking Glass Portrait 3D display

An addin for Autodesk Fusion 360 that lets you view your design in a Looking Glass Portrait 3D display

Always fill your package requirements without the user having to do anything! Simple and easy!

WSL Should now work always-fill-reqs-python3 Always fill your package requirements without the user having to do anything! Simple and easy! Supported

Make your functions return something meaningful, typed, and safe!
Make your functions return something meaningful, typed, and safe!

Make your functions return something meaningful, typed, and safe! Features Brings functional programming to Python land Provides a bunch of primitives

Make your Discord Account Online 24/7!

Online-Forever Make your Discord Account Online 24/7! A Code written in Python that helps you to keep your account 24/7. The main.py is the main file.

A simple bot that will help you in your learning and make it more fun.

hyperskill-SimpleChattyBot-python A simple bot that will help you in your learning and make it more fun. Syntax bot.py Stages Stage #1: Zuhura Bot we

Pyrmanent - Make all your classes permanent in a flash 💾

Pyrmanent A base class to make your Python classes permanent in a flash. Features Easy to use. Great compatibility. No database needed. Ask for new fe

Comments
  • Monterey 12.3 removed python 2

    Monterey 12.3 removed python 2

    Hey,

    First of all thank you so much for this helpful tool!

    As Apple has removed phyton 2.7 from Monterey 12.3 (see https://scriptingosx.com/2022/03/macos-monterey-12-3-removes-python-2-link-collection/) this project needs to be updated.

    opened by saschaeggi 5
Owner
François Simond
François Simond
This scrypt for auto brightness control

God damn. This scrypt for auto brightness control. The scrypt has voice assistant. You should move this script to auto-upload folder. What do you need

null 0 Jul 25, 2022
A python package to adjust the bias of probabilistic forecasts/hindcasts using "Mean and Variance Adjustment" method.

Documentation A python package to adjust the bias of probabilistic forecasts/hindcasts using "Mean and Variance Adjustment" method. Read documentation

null 1 Feb 2, 2022
Chess bot can play automatically as white or black on lichess.com, chess.com and any website using drag and drop to move pieces

Chessbot "Why create another chessbot ?" The explanation is simple : I did not find a free bot I liked online : all the bots I saw on internet are par

Dhimas Bagus Prayoga 2 Nov 11, 2021
The-White-Noise-Project - The project creates noise intentionally

The-White-Noise-Project High quality audio matters everywhere, even in noise. Be

Ali Hakim Taşkıran 1 Jan 2, 2022
A simple program to recolour simple png icon-like pictures with just one colour + transparent or white background. Resulting images all have transparent background and a new colour.

A simple program to recolour simple png icon-like pictures with just one colour + transparent or white background. Resulting images all have transparent background and a new colour.

Anna Tůmová 0 Jan 30, 2022
An unofficial python API for trading on the DeGiro platform, with the ability to get real time data and historical data.

DegiroAPI An unofficial API for the trading platform Degiro written in Python with the ability to get real time data and historical data for products.

Jorrick Sleijster 5 Dec 16, 2022
This library is an ongoing effort towards bringing the data exchanging ability between Java/Scala and Python

PyJava This library is an ongoing effort towards bringing the data exchanging ability between Java/Scala and Python

Byzer 6 Oct 17, 2022
TB Set color display - Add-on for Blender to set multiple objects and material Display Color at once.

TB_Set_color_display Add-on for Blender with operations to transfer name between object, data, materials and action names Set groups of object's or ma

null 1 Jun 1, 2022
Blender 3.1 Alpha (and later) PLY importer that correctly loads point clouds (and all PLY models as point clouds)

import-ply-as-verts Blender 3.1 Alpha (and later) PLY importer that correctly loads point clouds (and all PLY models as point clouds) Latest News Mand

Michael Prostka 82 Dec 20, 2022
Display your data in an attractive way in your notebook!

Bloxs Bloxs is a simple python package that helps you display information in an attractive way (formed in blocks). Perfect for building dashboards, re

MLJAR 192 Dec 28, 2022