Git Product home page Git Product logo

ril-py's Introduction

ril-py

Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust.

What's this?

This is a python binding around ril designed to provide an easy-to-use, high-level interface around image processing in Rust. Image and animation processing has never been this easy and fast before.

Support

โš  This package is a work in progress and it heavily depends on the progress of ril

By the first stable release, we plan to support the following image encodings:

Encoding Format Current Status
PNG / APNG Supported
JPEG Supported
GIF Supported
WebP Can't support (#8)
BMP Not yet supported
TIFF Not yet supported

Installation

Prebuilt wheels

There will be prebuilt wheels for these platforms:

  • Linux x86-64: Cpython 3.7+, PyPy 3.7, 3.8, 3.9
  • MacOS x86-64: Cpython 3.7+, PyPy 3.7, 3.8, 3.9
  • Windows x86-64: Cpython 3.7+, PyPy 3.7, 3.8, 3.9
  • Linux i686: Cpython 3.7+, PyPy 3.7, 3.8, 3.9
  • MacOS aarch64: Cpython 3.8+

If you want another platform to have prebuilt wheels, please open an issue.

CPython 3.11 support will be available once its ABI has been stabilized.

If your platform has prebuilt wheels, installing is as simple as

pip install ril

Building from Source

In order to build from source, you will need to have the Rust compiler available in your PATH. See documentation on https://rust-lang.org to learn how to install Rust on your platform.

Then building is as simple as

pip install ril

or from Github

pip install git+https://github.com/Cryptex-github/ril-py

Pip will handle the building process.

Examples

Open an image, invert it, and then save it:

from ril import Image

image = Image.open("example.png")
image.invert()

image.save("example.png")

Create a new black image, open the sample image, and paste it on top of the black image:

from ril import Image, Pixel

image = Image.new(600, 600, Pixel.from_rgb(0, 0, 0))
image.paste(100, 100, Image.open("sample.png"))

image.save("sample_on_black.png", "PNG") # You can also specify format if you like

ril-py's People

Contributors

cryptex-github avatar dependabot[bot] avatar jay3332 avatar ngh7mr3 avatar tom-the-bomb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ril-py's Issues

Webp support

I can't link libwebp statically into the final binary built for the wheel, so webp won't be supported until either I somehow figured out how to link it within the binary, or ril uses other solution.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.