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
An open-source plotting library for statistical data.

Lets-Plot Lets-Plot is an open-source plotting library for statistical data. It is implemented using the Kotlin programming language. The design of Le

JetBrains 820 Jan 06, 2023
VDLdraw - Batch plot the log files exported from VisualDL using Matplotlib

VDLdraw Batch plot the log files exported from VisualDL using Matplotlib. At pre

Yizhou Chen 5 Sep 26, 2022
Generate a roam research like Network Graph view from your Notion pages.

Notion Graph View Export Notion pages to a Roam Research like graph view.

Steve Sun 214 Jan 07, 2023
Minimal Ethereum fee data viewer for the terminal, contained in a single python script.

Minimal Ethereum fee data viewer for the terminal, contained in a single python script. Connects to your node and displays some metrics in real-time.

48 Dec 05, 2022
A simple script that displays pixel-based animation on GitHub Activity

GitHub Activity Animator This project contains a simple Javascript snippet that produces an animation on your GitHub activity tracker. The project als

16 Nov 15, 2021
This is a small repository for me to implement my simply Data Visualisation skills through Python.

Data Visualisations This is a small repository for me to implement my simply Data Visualisation skills through Python. Steam Population Chart from 10/

9 Dec 31, 2021
Matplotlib JOTA style for making figures

Matplotlib JOTA style for making figures This repo has Matplotlib JOTA style to format plots and figures for publications and presentation.

JOTA JORNALISMO 2 May 05, 2022
Example scripts for generating plots of Bohemian matrices

Bohemian Eigenvalue Plotting Examples This repository contains examples of generating plots of Bohemian eigenvalues. The examples in this repository a

Bohemian Matrices 5 Nov 12, 2022
HiPlot makes understanding high dimensional data easy

HiPlot - High dimensional Interactive Plotting HiPlot is a lightweight interactive visualization tool to help AI researchers discover correlations and

Facebook Research 2.4k Jan 04, 2023
100 data puzzles for pandas, ranging from short and simple to super tricky (60% complete)

100 pandas puzzles Puzzles notebook Solutions notebook Inspired by 100 Numpy exerises, here are 100* short puzzles for testing your knowledge of panda

Alex Riley 1.9k Jan 08, 2023
erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes

erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.

DrivenData 129 Jan 04, 2023
Here are my graphs for hw_02

Let's Have A Look At Some Graphs! Graph 1: State Mentions in Congressperson's Tweets on 10/01/2017 The graph below uses this data set to demonstrate h

7 Sep 02, 2022
metedraw is a project mainly for data visualization projects of Atmospheric Science, Marine Science, Environmental Science or other majors

It is mainly for data visualization projects of Atmospheric Science, Marine Science, Environmental Science or other majors.

Nephele 11 Jul 05, 2022
A little word cloud generator in Python

Linux macOS Windows PyPI word_cloud A little word cloud generator in Python. Read more about it on the blog post or the website. The code is tested ag

Andreas Mueller 9.2k Dec 30, 2022
A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews

hvPlot A high-level plotting API for the PyData ecosystem built on HoloViews. Build Status Coverage Latest dev release Latest release Docs What is it?

HoloViz 697 Jan 06, 2023
Create a visualization for Trump's Tweeted Words Using Python

Data Trump's Tweeted Words This plot illustrates twitter word occurences. We already did the coding I needed for this plot, so I was very inspired to

7 Mar 27, 2022
A simple python script using Numpy and Matplotlib library to plot a Mohr's Circle when given a two-dimensional state of stress.

Mohr's Circle Calculator This is a really small personal project done for Department of Civil Engineering, Delhi Technological University (formerly, D

Agyeya Mishra 0 Jul 17, 2021
Pglive - Pglive package adds support for thread-safe live plotting to pyqtgraph

Live pyqtgraph plot Pglive package adds support for thread-safe live plotting to

Martin Domaracký 15 Dec 10, 2022
An intuitive library to add plotting functionality to scikit-learn objects.

Welcome to Scikit-plot Single line functions for detailed visualizations The quickest and easiest way to go from analysis... ...to this. Scikit-plot i

Reiichiro Nakano 2.3k Dec 31, 2022