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
Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Simple python implementation with matplotlib to manually fit MIST isochrones to Gaia DR2 color-magnitude diagrams

Karl Jaehnig 7 Oct 22, 2022
A script written in Python that generate output custom color (HEX or RGB input to x1b hexadecimal)

ColorShell ─ 1.5 Planned for v2: setup.sh for setup alias This script converts HEX and RGB code to x1b x1b is code for colorize outputs, works on ou

Riley 4 Oct 31, 2021
Color scales in Python for humans

colorlover Color scales for humans IPython notebook: https://plot.ly/ipython-notebooks/color-scales/ import colorlover as cl from IPython.display impo

Plotly 146 Sep 25, 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 7, 2023
view cool stats related to your discord account.

DiscoStats cool statistics generated using your discord data. How? DiscoStats is not a service that breaks the Discord Terms of Service or Community G

ibrahim hisham 5 Jun 2, 2022
Blender addon that creates a temporary window of any type from the 3D View.

CreateTempWindow2.8 Blender addon that creates a temporary window of any type from the 3D View. Features Can the following window types: 3D View Graph

null 3 Nov 27, 2022
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 2.4k Jan 7, 2023
Custom ROI in Computer Vision Applications

EasyROI Helper library for drawing ROI in Computer Vision Applications Table of Contents EasyROI Table of Contents About The Project Tech Stack File S

null 43 Dec 9, 2022
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 209 Feb 17, 2021
3D Vision functions with end-to-end support for deep learning developers, written in Ivy.

Ivy vision focuses predominantly on 3D vision, with functions for camera geometry, image projections, co-ordinate frame transformations, forward warping, inverse warping, optical flow, depth triangulation, voxel grids, point clouds, signed distance functions, and others. Check out the docs for more info!

Ivy 61 Dec 29, 2022
Statistics and Visualization of acceptance rate, main keyword of CVPR 2021 accepted papers for the main Computer Vision conference (CVPR)

Statistics and Visualization of acceptance rate, main keyword of CVPR 2021 accepted papers for the main Computer Vision conference (CVPR)

Hoseong Lee 78 Aug 23, 2022
kyle's vision of how datadog's python client should look

kyle's datadog python vision/proposal not for production use See examples/comprehensive.py for a mostly working example of the proposed API. ?? ?? ❤️

Kyle Verhoog 2 Nov 21, 2021
BrowZen correlates your emotional states with the web sites you visit to give you actionable insights about how you spend your time browsing the web.

BrowZen BrowZen correlates your emotional states with the web sites you visit to give you actionable insights about how you spend your time browsing t

Nick Bild 36 Sep 28, 2022
An application that allows you to design and test your own stock trading algorithms in an attempt to beat the market.

StockBot is a Python application for designing and testing your own daily stock trading algorithms. Installation Use the

Ryan Cullen 280 Dec 19, 2022
With Holoviews, your data visualizes itself.

HoloViews Stop plotting your data - annotate your data and let it visualize itself. HoloViews is an open-source Python library designed to make data a

HoloViz 2.3k Jan 2, 2023
With Holoviews, your data visualizes itself.

HoloViews Stop plotting your data - annotate your data and let it visualize itself. HoloViews is an open-source Python library designed to make data a

HoloViz 1.8k Feb 17, 2021
With Holoviews, your data visualizes itself.

HoloViews Stop plotting your data - annotate your data and let it visualize itself. HoloViews is an open-source Python library designed to make data a

HoloViz 2.3k Jan 4, 2023
Design your own matplotlib stylefile interactively

Tired of playing with font sizes and other matplotlib parameters every time you start a new project or write a new plotting function? Want all you plots have the same style? Use matplotlib configuration files!

yobi byte 207 Dec 8, 2022
Show Data: Show your dataset in web browser!

Show Data is to generate html tables for large scale image dataset, especially for the dataset in remote server. It provides some useful commond line tools and fully customizeble API reference to generate html table different tasks.

Dechao Meng 83 Nov 26, 2022