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
🧇 Make Waffle Charts in Python.

PyWaffle PyWaffle is an open source, MIT-licensed Python package for plotting waffle charts. It provides a Figure constructor class Waffle, which coul

Guangyang Li 528 Jan 02, 2023
Manim is an animation engine for explanatory math videos.

A community-maintained Python framework for creating mathematical animations.

12.4k Dec 30, 2022
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
mysql relation charts

sqlcharts 自动生成数据库关联关系图 复制settings.py.example 重命名为settings.py 将数据库配置信息填入settings.DATABASE,目前支持mysql和postgresql 执行 python build.py -b,-b是读取数据库表结构,如果只更新匹

6 Aug 22, 2022
Focus on Algorithm Design, Not on Data Wrangling

The dataTap Python library is the primary interface for using dataTap's rich data management tools. Create datasets, stream annotations, and analyze model performance all with one library.

Zensors 37 Nov 25, 2022
Fast 1D and 2D histogram functions in Python

About Sometimes you just want to compute simple 1D or 2D histograms with regular bins. Fast. No nonsense. Numpy's histogram functions are versatile, a

Thomas Robitaille 237 Dec 18, 2022
This is simply repo for line drawing rendering using freestyle in Blender.

blender_freestyle_line_drawing This is simply repo for line drawing rendering using freestyle in Blender. how to use blender2935 --background --python

MaxLin 3 Jul 02, 2022
Python module for drawing and rendering beautiful atoms and molecules using Blender.

Batoms is a Python package for editing and rendering atoms and molecules objects using blender. A Python interface that allows for automating workflows.

Xing Wang 1 Jul 06, 2022
plotly scatterplots which show molecule images on hover!

molplotly Plotly scatterplots which show molecule images on hovering over the datapoints! Required packages: pandas rdkit jupyter_dash ➡️ See example.

150 Dec 28, 2022
web application for flight log analysis & review

Flight Review This is a web application for flight log analysis. It allows users to upload ULog flight logs, and analyze them through the browser. It

PX4 Drone Autopilot 145 Dec 20, 2022
Visualize the training curve from the *.csv file (tensorboard format).

Training-Curve-Vis Visualize the training curve from the *.csv file (tensorboard format). Feature Custom labels Curve smoothing Support for multiple c

Luckky 7 Feb 23, 2022
Pebble is a stat's visualization tool, this will provide a skeleton to develop a monitoring tool.

Pebble is a stat's visualization tool, this will provide a skeleton to develop a monitoring tool.

Aravind Kumar G 2 Nov 17, 2021
a simple REPL display lib for circuitpython

Circuitpython-termio-lib a simple REPL display lib for circuitpython Fonctions cls clear terminal screen and set cursor on top left : coords 0,0 usage

BeBoXoS 1 Nov 17, 2021
Data Visualizations for the #30DayChartChallenge

The #30DayChartChallenge This repository contains all the charts made for the #30DayChartChallenge during the month of April. This project aims to exp

Isaac Arroyo 7 Sep 20, 2022
a robust room presence solution for home automation with nearly no false negatives

Argos Room Presence This project builds a room presence solution on top of Argos. Using just a cheap raspberry pi zero w (plus an attached pi camera,

Angad Singh 46 Sep 18, 2022
Python support for Godot 🐍🐍🐍

Godot Python, because you want Python on Godot ! The goal of this project is to provide Python language support as a scripting module for the Godot ga

Emmanuel Leblond 1.4k Jan 04, 2023
Draw datasets from within Jupyter.

drawdata This small python app allows you to draw a dataset in a jupyter notebook. This should be very useful when teaching machine learning algorithm

vincent d warmerdam 505 Nov 27, 2022
An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

sweden-rent-dashboard An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden. The dashboard/web

Rory Crean 5 Dec 19, 2021
An open-source tool for visual and modular block programing in python

PyFlow PyFlow is an open-source tool for modular visual programing in python ! Although for now the tool is in Beta and features are coming in bit by

1.1k Jan 06, 2023