View part of your screen in grayscale or simulated color vision deficiency.

Overview

monolens

View part of your screen in grayscale or filtered to simulate color vision deficiency.

Watch the demo on YouTube.

Install with pip install monolens and then run monolens in a terminal or do it in one command with pipx run monolens.

Monolens was featured on Twitter by Matthew Feickert and Matplotlib, and picked up in this episode of Python Bytes. Thanks, guys!

Usage

  • Drag the lens around by holding a Mouse button down inside the window
  • Press Escape, Q, or double click on the lens to quit
  • Press up, down, left, right to resize the lens
  • Press Tab to switch between greyscale and different forms of simulated colorblindness
  • Press I to switch view label on/off
  • Press M to move the lens to another screen

On OSX, you need to give Monolens permission to make screenshots, which is safe.

Known limitations

  • The app is tested on OSX and Linux. It may flicker when you move the lens (less so on OSX). If you know how to fix this, please help. :)
  • Pulling the lens to another screen is currently not supported. See usage on how to switch screens instead.
  • The lens actually uses a static screenshot which is updated as you move the lens around. This trick is necessary, because an app cannot read the pixels under its own window. Because of this, the pixels under the app are only updated when you move the lens away first and then back. This is also the reason why the lens only works for static images.
  • On OSX, an ordinary app is not allowed to read pixels outside of its window for security reasons, which is why this app needs special permissions. Giving permissions is safe; Monolens contains no networking code and will neither store nor send your pixels anywhere.

Future plans

  • Support gestures to rescale the lens (pinch etc)
Comments
  • GitHub Action to lint Python code

    GitHub Action to lint Python code

    Output: https://github.com/cclauss/monolens/actions

    Future PRs should remove || true from:

    • [ ] isort --check-only --profile black . || true
    • [ ] pytest . || true
    opened by cclauss 1
  • Monolens sees through open application windows

    Monolens sees through open application windows

    When I open monolens on OSX 10.15.7 (Catalina) the viewer window always appears to peer through any of the application windows I have open and show only the desktop. For example, in the screenshot below I have a PDF document open in Preview but the monolens window views through it to the desktop image (which I have as the default OSX Catalina one):

    image

    or here when I call it using pipx:

    image

    I am not sure if this is in any way related to the permissions setup described in the project README,

    On OSX, you need to give Monolens permission to make screenshots, which is safe.

    I am unsure how to actively give those permissions.

    Any ideas?

    opened by dantrim 1
  • Using published package on pypi doesn't work because readme is not found

    Using published package on pypi doesn't work because readme is not found

    ❯ monolens
    Traceback (most recent call last):
      File "/home/maxnoe/.local/bin/monolens", line 8, in <module>
        sys.exit(main())
      File "/home/maxnoe/.local/lib/python3.9/site-packages/monolens/__init__.py", line 25, in main
        intro = Intro()
      File "/home/maxnoe/.local/lib/python3.9/site-packages/monolens/intro.py", line 17, in __init__
        with open(Path(__file__).parent / ".." / "README.md") as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/home/maxnoe/.local/lib/python3.9/site-packages/monolens/../README.md'
    
    opened by maxnoe 1
  • Fix wrong method name in enterEvent

    Fix wrong method name in enterEvent

    Fixes this error:

    Traceback (most recent call last):
      File "/home/maxnoe/.local/lib/python3.9/site-packages/monolens/widget.py", line 48, in enterEvent
        super(Widget, self).eventEvent(event)
    AttributeError: 'super' object has no attribute 'eventEvent'
    

    When entering with the mouse.

    opened by maxnoe 1
  • [pre-commit.ci] pre-commit autoupdate

    [pre-commit.ci] pre-commit autoupdate

    opened by pre-commit-ci[bot] 0
  • Missing wayland support

    Missing wayland support

    I tried monolens under wayland with the sway window manager via pipx and it crashed with

    On OSX, you need to give Monolens permission to make screenshots, which is safe.
    Traceback (most recent call last):
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/bin/monolens", line 8, in <module>
        sys.exit(main())
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/__init__.py", line 46, in main
        lens = Lens()
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/lens.py", line 35, in __init__
        self._updateScreenshot(self.screen())
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/lens.py", line 187, in _updateScreenshot
        self._updateConverted()
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/lens.py", line 191, in _updateConverted
        util.grayscale(self._converted, self._screenshot)
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/util.py", line 66, in grayscale
        s = qimage_array_view(source)
      File "/home/michael/.local/pipx/.cache/ec49a1adcc18bdc/lib/python3.9/site-packages/monolens/util.py", line 45, in qimage_array_view
        assert format == QtGui.QImage.Format_RGB32
    AssertionError
    

    I'm not entirely surprise, since screenshotting utilities etc. are different under wayland. But from the stacktrace it's not obvious why exactly it crashed and in theory, Qt should be able to handle wayland, or shouldn't it?

    Anyway, would be cool if someone else could try it and if they can reproduce it, add it to the limitations in the readme, after all wayland is slowly becoming more mainstream. But maybe just something with my system configuration is broken :man_shrugging:

    opened by meliache 3
Owner
Hans Dembinski
Particle physicist, C++ and Python expert, statistician. Author of boost::histogram.
Hans Dembinski
Python scripts for plotting audiograms and related data from Interacoustics Equinox audiometer and Otoaccess software.

audiometry Python scripts for plotting audiograms and related data from Interacoustics Equinox 2.0 audiometer and Otoaccess software. Maybe similar sc

Hamilton Lab at UT Austin 2 Jun 15, 2022
TensorDebugger (TDB) is a visual debugger for deep learning. It extends TensorFlow with breakpoints + real-time visualization of the data flowing through the computational graph

TensorDebugger (TDB) is a visual debugger for deep learning. It extends TensorFlow (Google's Deep Learning framework) with breakpoints + real-time visualization of the data flowing through the comput

Eric Jang 1.4k Dec 15, 2022
`charts.css.py` brings `charts.css` to Python. Online documentation and samples is available at the link below.

charts.css.py charts.css.py provides a python API to convert your 2-dimension data lists into html snippet, which will be rendered into charts by CSS,

Ray Luo 3 Sep 23, 2021
Generate visualizations of GitHub user and repository statistics using GitHub Actions.

GitHub Stats Visualization Generate visualizations of GitHub user and repository statistics using GitHub Actions. This project is currently a work-in-

Aditya Thakekar 1 Jan 11, 2022
Collection of scripts for making high quality beautiful math-related posters.

Poster Collection of scripts for making high quality beautiful math-related posters. The poster can have as large printing size as 3x2 square feet wit

Nattawut Phetmak 3 Jun 09, 2022
An interactive dashboard for visualisation, integration and classification of data using Active Learning.

AstronomicAL An interactive dashboard for visualisation, integration and classification of data using Active Learning. AstronomicAL is a human-in-the-

45 Nov 28, 2022
ipyvizzu - Jupyter notebook integration of Vizzu

ipyvizzu - Jupyter notebook integration of Vizzu. Tutorial · Examples · Repository About The Project ipyvizzu is the Jupyter Notebook integration of V

Vizzu 729 Jan 08, 2023
Because trello only have payed options to generate a RunUp chart, this solves that!

Trello Runup Chart Generator The basic concept of the project is that Corello is pay-to-use and want to use Trello To-Do/Doing/Done automation with gi

Rômulo Schiavon 1 Dec 21, 2021
Create HTML profiling reports from pandas DataFrame objects

Pandas Profiling Documentation | Slack | Stack Overflow Generates profile reports from a pandas DataFrame. The pandas df.describe() function is great

10k Jan 01, 2023
ScisorWiz: Differential Isoform Visualizer for Long-Read RNA Sequencing Data

ScisorWiz: Vizualizer for Differential Isoform Expression README ScisorWiz is a linux-based R-package for visualizing differential isoform expression

Alexander Stein 6 Oct 04, 2022
Movies-chart - A CLI app gets the top 250 movies of all time from imdb.com and the top 100 movies from rottentomatoes.com

movies-chart This CLI app gets the top 250 movies of all time from imdb.com and

3 Feb 17, 2022
Rick and Morty Data Visualization with python

Rick and Morty Data Visualization For this project I looked at data for the TV show Rick and Morty Number of Episodes at a Certain Location Here is th

7 Aug 29, 2022
Log visualizer for whirl-framework

Lumberjack Log visualizer for whirl-framework Установка pip install -r requirements.txt Как пользоваться python3 lumberjack.py -l путь до лога -o

Vladimir Malinovskii 2 Dec 19, 2022
It's an application to calculate I from v and r. It can also plot a graph between V vs I.

Ohm-s-Law-Visualizer It's an application to calculate I from v and r using Ohm's Law. It can also plot a graph between V vs I. Story I'm doing my Unde

Sihab Sahariar 1 Nov 20, 2021
Visualizations of some specific solutions of different differential equations.

Diff_sims Visualizations of some specific solutions of different differential equations. Heat Equation in 1 Dimension (A very beautiful and elegant ex

2 Jan 13, 2022
Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from time series data.

ts2vg: Time series to visibility graphs The Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from t

Carlos Bergillos 26 Dec 17, 2022
SummVis is an interactive visualization tool for text summarization.

SummVis is an interactive visualization tool for analyzing abstractive summarization model outputs and datasets.

Robustness Gym 246 Dec 08, 2022
Generate "Jupiter" plots for circular genomes

jupiter Generate "Jupiter" plots for circular genomes Description Python scripts to generate plots from ViennaRNA output. Written in "pidgin" python w

Robert Edgar 2 Nov 29, 2021
A simple agent-based model used to teach the basics of OOP in my lectures

Pydemic A simple agent-based model of a pandemic. This is used to teach basic principles of object-oriented programming to master students. It is not

Fabien Maussion 2 Jun 08, 2022
Histogramming for analysis powered by boost-histogram

Hist Hist is an analyst-friendly front-end for boost-histogram, designed for Python 3.7+ (3.6 users get version 2.4). See what's new. Installation You

Scikit-HEP Project 97 Dec 25, 2022