ModernGL is a python wrapper over OpenGL 3.3+ core

Overview

preview

ModernGL

pypi anaconda rtd

ModernGL is a python wrapper over OpenGL 3.3+ core that simplifies the creation of simple graphics applications like scientific simulations, games or user interfaces. Usually, acquiring in-depth knowledge of OpenGL requires a steep learning curve. In contrast, ModernGL is easy to learn and use, moreover it is capable of rendering with high performance and quality, with less code written. The majority of the moderngl code base is also written in C++ for high performance.

pip install moderngl

NOTE: From moderngl 5.6 context creation is delegated to the glcontext package. This makes us able to expand and improve context creation without releasing new versions of moderngl. It also makes it possible for users to customize their own context creation and the bar for contributing should be lower. New backends can be created using ctypes or C++.

Features

  • GPU accelerated high quality graphics
  • Rendering modern OpenGL scenes with less headache
  • Simpler and faster than PyOpenGL
  • Can render without a window
  • 100% Pythonic

Sample usage

>>> import moderngl
>>> ctx = moderngl.create_standalone_context()
>>> buf = ctx.buffer(b'Hello World!')  # allocated on the GPU
>>> buf.read()
b'Hello World!'

For complete examples please visit the Examples.

Easy to use with Pillow and Numpy

>>> img = Image.open('texture.jpg')
>>> ctx.texture(img.size, 3, img.tobytes())
<Texture: 1>
>>> ctx.buffer(np.array([0.0, 0.0, 1.0, 1.0], dtype='f4'))
<Buffer: 1>

Compared to PyOpenGL

With PyOpenGL, using the original OpenGL API, you have to write three lines to achieve a simple task like binding a VBO:

vbo1 = glGenBuffers(1)
GL.glBindBuffer(GL_ARRAY_BUFFER, vbo1)
GL.glBufferData(GL_ARRAY_BUFFER, b'Hello World!', GL_STATIC_DRAW)

vbo2 = glGenBuffers(1)
GL.glBindBuffer(GL_ARRAY_BUFFER, vbo2)
GL.glBufferData(GL_ARRAY_BUFFER, b'\x00' * 1024, GL_DYNAMIC_DRAW)

With ModernGL you need just one simple line per VBO to achieve the same results:

vbo1 = ctx.buffer(b'Hello World!')
vbo2 = ctx.buffer(reserve=1024, dynamic=True)

Build

build build

python setup.py build_ext --inplace

FAQ

Is ModernGL faster than PyOpenGL?

In many cases yes, the core functions of ModernGL are written in C++, OpenGL functions are called in quick succession so these calls together count as a single python function call.

What version of OpenGL is used?

Most of the calls only require OpenGL 3.3 but Subroutines and Compute Shaders require OpenGL 4.0 and OpenGL 4.3

Is my old PC supported?

OpenGL 3.3 came out in February 2010. With up to date drivers you will be able to use the most of the ModernGL functions, even on integrated graphics cards. (Compute Shaders will likely not work depending on how old your PC is.)

You can still try using Mesa but performance would be limited.

Where can I use ModernGL?

Anywhere where OpenGL is supported. ModernGL is capable of rendering using a standalone_context as well. Rendering to a window only requires a valid OpenGL context.

Can ModernGL create a Window?

NO, but we provide a utility library moderngl-window making window creation and resource loading very simple.

Limitations using ModernGL over PyOpenGL?

All the necessary calls are (or can be) implemented in ModernGL. However you can interact with the ModernGL objects from PyOpenGL. If something is missing write an issue or raise a PR.

Supported platforms

  • Windows
  • Linux
  • Mac

Installing from source

Installing on Ubuntu from source

apt-get install python3-dev libgl1-mesa-dev libx11-dev
python3 setup.py install

Building the sphinx documentation

pip install -r docs/requirements.txt
python setup.py build_sphinx

Running tests

pip install -r tests/requirements.txt
pytest tests

Some of the tests may be skipped when the supported OpenGL version is below the requirements of the given test.

Headless rendering

apt-get install xvfb
alias xpy='xvfb-run -s "-screen 0 1x1x24" python3'
xpy -m moderngl

Code quality

Code is tested with pep8, flake8, prospector and pylint

Community

Citation

If you need to cite this repository in academic research:

@Online{Dombi2020,
  author = {Szabolcs Dombi},
  title = {ModernGL, high performance python bindings for OpenGL 3.3+},
  date = {2020-05-01},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/moderngl/moderngl}},
  commit = {}
}

If commit hash is required this can be found per release here: https://github.com/moderngl/moderngl/releases

Contributors

and many others

Thank You!

Contributions are welcome. (Please add yourself to the list)

Comments
  • Error running moderngl in Colab.

    Error running moderngl in Colab.

    I'm trying to run moderngl in Colab. I installed it and ran a virtual display:

    !sudo apt-get update --fix-missing && apt-get -qqq install x11-utils > /dev/null
    !sudo apt-get update --fix-missing && apt-get -qqq install xvfb > /dev/null
    !python3 -m pip install -U -qqq moderngl
    !python3 -m pip install -U -qqq moderngl-window
    !python3 -m pip install -U -qqq pyvirtualdisplay
    
    from pyvirtualdisplay import Display
    display = Display(visible=0, size=(960, 540)).start()
    
    import moderngl
    ctx = moderngl.create_standalone_context()
    buf = ctx.buffer(b'Hello World!')  # allocated on the GPU
    buf.read()
    
    b'Hello World!'
    

    It printed as expected, but when I run an example I see the error:

    !python3 /content/moderngl/examples/basic_alpha_blending.py --window pyglet
    
    2020-03-28 10:25:48,312 - moderngl_window - INFO - Attempting to load window class: moderngl_window.context.pyglet.Window
    Traceback (most recent call last):
      File "/content/moderngl/examples/basic_alpha_blending.py", line 74, in <module>
        AlphaBlending.run()
      File "/content/moderngl/examples/ported/_example.py", line 21, in run
        mglw.run_window_config(cls)
      File "/usr/local/lib/python3.6/dist-packages/moderngl_window/__init__.py", line 185, in run_window_config
        cursor=show_cursor if show_cursor is not None else True,
      File "/usr/local/lib/python3.6/dist-packages/moderngl_window/context/pyglet/window.py", line 54, in __init__
        config=config,
      File "/usr/local/lib/python3.6/dist-packages/pyglet/window/xlib/__init__.py", line 165, in __init__
        super(XlibWindow, self).__init__(*args, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/pyglet/window/__init__.py", line 588, in __init__
        config = screen.get_best_config(config)
      File "/usr/local/lib/python3.6/dist-packages/pyglet/canvas/base.py", line 194, in get_best_config
        raise window.NoSuchConfigException()
    pyglet.window.NoSuchConfigException
    

    I also tried with another virtual display, but the result is the same:

    !python3 -m pip install -U -qqq  xvfbwrapper
    from xvfbwrapper import Xvfb
    display = Xvfb(width=960, height=540).start()
    
    pyglet.window.NoSuchConfigException
    
    opened by qo4on 39
  • Api for writing to image2D texture in compute shader

    Api for writing to image2D texture in compute shader

    A simple use-case of the new feature

    In a compute shader it is often necessary to be able to write to a texture via an image2D uniform. A compute shader example for modifying an image2D texture is

    #version 430
    layout (local_size_x = 16, local_size_y = 16) in;
    layout(rg32f,location=0) writeonly uniform image2D destTex;
    uniform float time;
    void main() {
        ivec2 ij = ivec2(gl_GlobalInvocationID.xy);
        float localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0);
        float globalCoef = sin(float(gl_WorkGroupID.x+gl_WorkGroupID.y)*0.1 + time)*0.5;
        imageStore(destTex, ij, vec4(1.0-globalCoef*localCoef, 0.0, 0.0, 0.0));
    }
    

    Note that this requires on initialization an explicit call to bind the image texture in addition to the setting of it's uniform to 0

    glGenTextures(1, &texHandle); glBindImageTexture(0, texHandle, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_R32F); glUniform1i(glGetUniformLocation(progHandle, "destTex"), 0);

    when trying the equivalent of glUniform1i

    self.destTex= self.computeprog['destTex'] self.destTex.value = 0

    the getter is works fine but an error is thrown on the setter

      File "foo.py", line 204, in foo_execute()
        self.destTex.value = 0
      File "C:/msys64/mingw64/lib/python3.6/site-packages\moderngl\program_members\uniform.py", line 163, in value
        self.mglo.value = value
    mgl.Error: cannot detect uniform type
    

    This seems to be a bug where a uniform image2D type is not correctly handled when trying to set the uniform integer.

    Describe the solution you'd like

    Assuming the uniform image2D is corrected, there seems to be a larger missing API piece. Presently, the moderngl interface seems to be missing a way to do the equivalent of

    glBindImageTexture(0, texHandle, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_R32F);

    How does one bind the image texture to be writeonly with a format of GL_R32F? Note, this is required in addition to the standard texture glBindTexture(GL_TEXTURE_2D, texHandle). For example, when one inits the texture a complete working c-code is

    GLuint genTexture() {
        GLuint texHandle;
        glGenTextures(1, &texHandle);
    
        glActiveTexture(GL_TEXTURE0);
        glBindTexture(GL_TEXTURE_2D, texHandle);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 512, 512, 0, GL_RED, GL_FLOAT, NULL);
    
        // Because we're also using this tex as an image (in order to write to it),
        // we bind it to an image unit as well
        glBindImageTexture(0, texHandle, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_R32F);
        return texHandle;
    }
    

    The goal is to have an animated texture with compute shader like goal_mixed_vertexshader_computeshader

    Here's a an python-moderngl coding attempt at that goal but doesn't work, possibly due to missing API feature as described above. Note this is a slight change example 04. mixed_vertexshader_computeshader.py,txt

    Version info

    moderngl 5.3.0

    vendor: NVIDIA Corporation renderer: Quadro M1200/PCIe/SSE2 version: 4.6.0 NVIDIA 388.16 python: 3.6.4 (default, Jan 23 2018, 13:17:37) [GCC 7.2.0 64 bit (AMD64)] platform: win32 code: 460

    
    
    
    
    new feature 
    opened by pocdn 23
  • x11: cannot choose visual - create_standalone_context()

    x11: cannot choose visual - create_standalone_context()

    Description

    In the blending example given in documentation:

    For both rgb and alpha

    ctx.blend_func = moderngl.SRC_ALPHA, moderngl.ONE_MINUS_SRC_ALPHA

    Separate for rgb and alpha

    ctx.blend_func = ( moderngl.SRC_ALPHA, moderngl.ONE_MINUS_SRC_ALPHA, moderngl.ONE, moderngl.ONE )

    For both rgb and alpha mode works, while separate for rgb and alpha mode gives: SystemError: error return without exception set

    Documentation 
    opened by sunweilunformatech 22
  • Add support for Other Python GUI toolkits

    Add support for Other Python GUI toolkits

    Hi, Can the development team please add support for Python GUI toolkits like Tkinter Wxwidgets

    These two toolkits work well on Linux osx, Mac osx, Windows. So if ModernGL supports tk and wxpython, I can develop a scientific app like molecular viewer using Python 3.4 and ModernGL for OpenGL 4.5 rendering.

    Thank you for your efforts in this project

    opened by belalmedhat 22
  • Share between context

    Share between context

    I was wondering if it is possible to share textures between contexts

    As afar I know there is no way to create a texture from an existing texture right?

    Describe the solution you'd like

    Is it possible to do something like this?

    # setup the first window ...
    ctx1 = moderngl.create_context()
    texture1 = ctx1.texture((H, W), 4)
    
    # setup the second window ...
    ctx2 = moderngl.create_context()
    texture2 = ctx2.texture(texture1)
    frame = ctx2.framebuffer((texture2,))
    

    Where ctx2.texture function will check if texture1 can be shared and create a texture that is shared between ctx1 and ctx2.

    Version info

    moderngl 5.5.4
    --------------
    vendor: NVIDIA Corporation
    renderer: GeForce GTX 1080 Ti/PCIe/SSE2
    version: 4.6.0 NVIDIA 430.64
    python: 3.6.9 (default, Nov  7 2019, 10:44:02)
    [GCC 8.3.0]
    platform: linux
    code: 460
    
    question Documentation 
    opened by DarwinSenior 20
  • Cannot create OpenGL context on server

    Cannot create OpenGL context on server

    Hello,

    I was trying to use this library on a remote server without a display. Thus, I got the error:

    Cannot create context

    Are there any solutions how to do headless / offline-rendering using ModernGL ?

    opened by henzler 20
  • EGL backend fails in docker container

    EGL backend fails in docker container

    Description

    egl backend fails to initialize in docker container:

    import moderngl
    moderngl.create_standalone_context(backend="egl")
    
    Traceback (most recent call last):
      File "egl_test.py", line 2, in <module>
        moderngl.create_standalone_context(backend="egl")
      File "/root/miniconda3/envs/env/lib/python3.7/site-packages/moderngl/context.py", line 1466, in create_standalone_context
        ctx.mglo, ctx.version_code = mgl.create_context(glversion=require, mode=mode, **settings)
      File "/root/miniconda3/envs/env/lib/python3.7/site-packages/glcontext/__init__.py", line 99, in create
        return egl.create_context(**kwargs)
    Exception: eglInitialize failed (0x3001)
    

    I might just be doing something wrong, but I'm not sure what it is. It works for my example program.

    Proof of code

    https://github.com/christopher-hesse/moderngl-issue

    docker build . --tag egl_test
    docker run -it --rm egl_test bash -c "gcc egl_test.c -lEGL -lOpenGL && ./a.out && tail out.ppm"
    docker run -it --rm egl_test python egl_test.py
    

    The first docker run runs a simple egl program which seems to be working because it outputs a PPM file. The second crashes with the above error.

    Expected behavior

    I expected it to work instead of crashing. Could this be some sort of gl version issue?

    Version info

    docker run -it --rm egl_test pip show moderngl glcontext
    Name: moderngl
    Version: 5.6.0
    Summary: ModernGL: High performance rendering for Python 3
    Home-page: https://github.com/moderngl/moderngl
    Author: Szabolcs Dombi
    Author-email: [email protected]
    License: MIT
    Location: /root/miniconda3/envs/env/lib/python3.7/site-packages
    Requires: glcontext
    Required-by:
    ---
    Name: glcontext
    Version: 2.1.0
    Summary: Portable OpenGL Context
    Home-page: https://github.com/moderngl/glcontext
    Author: Szabolcs Dombi
    Author-email: [email protected]
    License: MIT
    Location: /root/miniconda3/envs/env/lib/python3.7/site-packages
    Requires:
    Required-by: moderngl
    
    opened by christopher-hesse 18
  • Triangles do not appear in headless-rendering on Ubuntu

    Triangles do not appear in headless-rendering on Ubuntu

    Description

    With reference to the following URLs, I wrote some headless-rendering codes. The codes worked on Windows 10, but didn't on Ubuntu 16.04. It seems that ctx.clear() works but vao.render() doesn't.

    • https://github.com/cprogrammer1994/ubuntu-headless-ModernGL/blob/master/README.md
    • https://github.com/cprogrammer1994/Headless-rendering-with-python

    Proof of code

    Here's a short version of my headless-rendering code:

    http://kanamori.cs.tsukuba.ac.jp/tmp/moderngl/sample.py

    $ export DISPLAY=:99.0
    $ Xvfb :99 -screen 0 640x480x24 &
    $ python sample.py
    

    yields the following white image:

    http://kanamori.cs.tsukuba.ac.jp/tmp/moderngl/output_ubuntu.png

    Expected behavior

    On Windows 10, I got the following image as expected.

    http://kanamori.cs.tsukuba.ac.jp/tmp/moderngl/output_windows.png

    Version info

    $ python -m moderngl
    moderngl 5.5.4
    --------------
    vendor: VMware, Inc.
    renderer: llvmpipe (LLVM 6.0, 256 bits)
    version: 3.3 (Core Profile) Mesa 18.0.5
    python: 3.6.6 (default, Jul 23 2018, 14:41:45)
    [GCC 5.4.0 20160609]
    platform: linux
    code: 330
    

    Here's also a log of glxinfo:

    http://kanamori.cs.tsukuba.ac.jp/tmp/moderngl/glxinfo_dump.txt

    opened by yshhrknmr 18
  • Python39 manylinux wheels are missing

    Python39 manylinux wheels are missing

    Description

    Similarly to issue #17 of glcontext, moderngl lacks the manylinux wheels on pypi https://pypi.org/project/moderngl/#files

    Proof of code

    Please refer to the files listsing of pypi: https://pypi.org/project/moderngl/#files

    Expected behavior

    pip install moderngl shall not need to compile the module on Linux using python-3.9

    Thanks in advance for looking into this.

    opened by FrankFirsching 16
  • Rendering dependency on vertex_array

    Rendering dependency on vertex_array

    I have been using moderngl for a while and have come to appreciate how simple it is to get things done. However, it seems that all rendering is done through the vertex_array Render call, and there is an expectation that the vertex buffer be non-zero in length. This is very different from OpenGL in C where you don't even need a vertex buffer to be bound prior to a draw call. You can call glDrawArrays(GL_POINTS, 0, numVerts), with an empty vertex shader, and the geometry shader will get invoked numVerts times, with a unique value of gl_PrimitiveIDIn. This is useful for creating geometry on the fly. I have not been able to replicate this functionality using moderngl. Is this a design flaw, or a gap in the example code?

    Thanks.

    opened by charlesloop 16
  • pypy compatibility

    pypy compatibility

    Pypy is an alternative Python implementation with JIT.

    Curretnly moderngl doesn't compile due to non-existence of following in pypy C API:

    • 5.5.0:
      • PyException_HEAD macro
      • PyUnicode_Append
    • next:
      • ob_base inside PyObject
    opened by atomizer 14
  • Add SPIR-V shader support

    Add SPIR-V shader support

    A simple use-case of the new feature

    Using SPIR-V, you may be able to use other languages then glsl, eg. HLSL. It should only be enabled if you have OpenGL 4.6 or higher. SPIR-V is also cross-api, meaning you can write a shader once and use it for all sorts of APIs (eg one can have moderngl support with other apis).

    Describe the solution you'd like

    Add SPIR-V shader support with preferably a similar way to load them. (eg. instead of ctx.program you could have ctx.spirv_program).

    Version info

    moderngl 5.7.3
    --------------
    vendor: Intel
    renderer: Intel(R) UHD Graphics 600
    version: 3.3.0 - Build 27.20.100.8681
    python: 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]
    platform: win32
    code: 330
    
    opened by XEN486 1
  • Add internal_format parameter to other texture types

    Add internal_format parameter to other texture types

    Currently only Texture supports setting the internal format. I would like to be able to create cubemap (and possibly other kinds of) textures that are compressed.

    improvement being addressed by the refactor 
    opened by yonibr 1
  • How to release the memory used by moderngl context?

    How to release the memory used by moderngl context?

    Hello, I created a moderngl context in Python and called context.release(), but the memory never gets released. Here it is the code:

    import gc
    import moderngl.mgl as mgl
    from moderngl.context import Context
    
    ctx = Context.__new__(Context)
    ctx.mglo, ctx.version_code = mgl.create_context(glversion=330, mode="standalone")
    ctx.release()
    del(ctx)
    gc.collect()
    

    image

    There is approximately 50MB of memory that is not being released even after context.release(), del(context) or gc.collect(), so how can I retrieve this memory back? I would really appreciate any help on this!

    opened by FilipeMarch 24
  • Wayland: Context creation failed

    Wayland: Context creation failed

    Upgrading from moderngl 5.5.3 to 5.6.4

    Traceback (most recent call last):
      File "/home/istvan/Work/Mollia/mollia_window_linux/test_main_window_mouse.py", line 7, in <module>
        ctx = mgl.create_context()
      File "/home/istvan/.local/lib/python3.10/site-packages/moderngl/context.py", line 1619, in create_context
        ctx.mglo, ctx.version_code = mgl.create_context(glversion=require, mode=mode, **settings)
      File "/home/istvan/.local/lib/python3.10/site-packages/glcontext/__init__.py", line 93, in create
        return x11.create_context(**kwargs)
    Exception: (detect) glXGetCurrentContext: cannot detect OpenGL context
    
    Linux fedora 5.17.12-300.fc36.x86_64 #1 SMP PREEMPT Mon May 30 16:56:53 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
    
    bug 
    opened by istvan-szollosi 4
  • Support OpenGL ES 3.1/2

    Support OpenGL ES 3.1/2

    The mesa drivers for the gpu on the Cortex-A72 is now supporting ES 3.1 with extensions for most of the 3.2 features. With recent mesa version you have geo shaders and compute shaders working.

    Some differences in GLES:

    • Primitive restart index can only be the max value of the index buffer size
    • Does not support pixel data format conversion during write (format different from internalformat)
    • Compute shader only allows textures with immutable storage. Textures will need an option for this.

    Shaders on the raspi will need to look like the following.

    // shader version
    #version 310 es
    // Enable geo shaders (3.2 feature)
    #extension GL_EXT_geometry_shader : require
    // We need precision qualifiers for floats
    precision mediump float;
    // We need precision qualifiers for images
    precision mediump image2D;
    
    being addressed by the refactor 
    opened by einarf 12
Releases(5.7.4)
A simple Streamlit Component to compare images in Streamlit apps. It integrates Knightlab's JuxtaposeJS

streamlit-image-juxtapose A simple Streamlit Component to compare images in Streamlit apps using Knightlab's JuxtaposeJS. The images are saved to the

Robin 30 Dec 31, 2022
CropImage is a simple toolkit for image cropping, detecting and cropping main body from pictures.

CropImage is a simple toolkit for image cropping, detecting and cropping main body from pictures. Support face and saliency detection.

Haofan Wang 15 Dec 22, 2022
Tool to create a Phunk image with a custom background

Create Phunk image Tool to create a Phunk image with a custom background Installation Clone the repo git clone https://github.com/albanow/etherscan_sa

Albano Pena Torres 6 Mar 31, 2022
Extract the temperature data of each wire from the thermal imager raw data.

Wire-Tempurature-Detection Extract the temperature data of each wire from the thermal imager raw data. The motivation of this computer vision project

JohanAckerman 1 Nov 03, 2021
Typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts.

typesheet typesheet is a tiny Python script for creating transparent PNG spritesheets from TrueType (.ttf) fonts. I made it because I couldn't find an

Grayson Chao 12 Dec 23, 2022
Remove Background from Image With Python

Install Library pypi $ pip3 install xremovebg

krypton 4 May 26, 2022
An agnostic Canvas API for the browser-less and insane

Apollo An agnostic Canvas API for the browser-less and mildly insane. Project Apollo is a Pythonic re-imagining of HTML Canvas element implementati

1 Jan 13, 2022
Rotates your images in the spirit of rot13

Image Rotator (imrot10) Its like rot13 but for images. Calling the algorithm imrot10 for im = image, rot = rotation, 10 = default magnitude. Unfortuna

Sarah 2 Dec 10, 2021
Archive of the image generator stuff from my API

alex_api_archive Archive of the image generator stuff from my API FAQ Q: Why? A: Because I am removing these components from the API Q: How do I run i

AlexFlipnote 26 Nov 17, 2022
Simple program to easily view Euler parameters in 3D.

Simple program to easily view Euler parameters in 3D.

5 Aug 20, 2021
HTML2Image is a lightweight Python package that acts as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.

A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.

176 Jan 01, 2023
Python Digital Art Generator

Python Digital Art Generator The main goal of this repository is to generate all possible layers permutations given by the user in order to get unique

David Cuentas Mar 3 Mar 12, 2022
A sketch like(?) effect for images

lineArt A sketch like(?) effect for images How to run main.py [filename] [option {1,2}] option 1 retains colour option 2 gives gray image #results ori

1 Oct 28, 2021
This is a python project which detects color of an image when you double click on it.

This is a python project which detects color of an image when you double click on it. You have to press ESC button to close the pop-up Image window. There are mainly two library CV2 and Pandas that a

Yashwant Kumar Singh 0 Aug 16, 2022
Conversion of Image, video, text into ASCII format

asciju Python package that converts image to ascii Free software: MIT license

Aju Tamang 11 Aug 22, 2022
The ctypes-based simple ImageMagick binding for Python

Wand Wand is a ctypes-based simple ImageMagick binding for Python, supporting 2.7, 3.3+, and PyPy. All functionalities of MagickWand API are implement

Eric McConville 1.2k Dec 30, 2022
PyGram Instagram-like image filters.

PyGram Instagram-like image filters. Usage First, import the client: from filters import * Instanciate a filter and apply it: f = Nashville("image.jp

Ajay Kumar Nagaraj 102 Feb 21, 2022
The friendly PIL fork (Python Imaging Library)

Pillow Python Imaging Library (Fork) Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lund

Pillow 10.4k Dec 31, 2022
Image comparison slider component for Streamlit

Streamlit Image Comparison Component A simple Streamlit Component to compare images with a slider in Streamlit apps using Knightlab's JuxtaposeJS. It

fatih 109 Dec 23, 2022
Pythonocc nodes for Ryven

Pythonocc-nodes-for-Ryven Pythonocc nodes for Ryven Here a way to work on Pythonocc with a node editor, Ryven in that case. To get it functional you w

Tanneguy 30 Dec 18, 2022