Skip to main content

Image and 2D Geometry library for easy and fast image manipulation

Project description

Otary

Otary library, readable, fast, unified, interactive, flexible, pythonic

Package version License License Code style: black

Welcome to Otary

Otary is a powerful Python library for advanced image and 2D geometry manipulation.

Features

The main features of Otary are:

  • Readability: designed to be easy to read and understand, making it suitable for beginners and experienced developers alike.

  • Performance: optimized for speed and efficiency, making it suitable for high-performance applications. It is built on top of NumPy and OpenCV, which are known for their speed and performance.

  • Unification: Otary unifies multiple libraries into a single, unified library, making it easier to use without the need to switch between multiple libraries. Spend less time learning different APIs and reading multiple documentations.

  • Interactiveness: designed to be interactive and user-friendly, making it suitable for interactive applications like Jupyter notebooks.

  • Flexibility: provides a flexible and extensible architecture, allowing developers to customize and extend its functionality as needed.

  • Pythonic: designed to be Pythonic and easy to use, making it suitable for Python developers.

Installation

Otary is available on PyPI. You can install it with:

pip install otary

Example

Let me illustrate the usage of Otary with a simple example. Imagine you need to:

  1. read an image from a pdf file
  2. crop a part of it
  3. rotate the cropped image
  4. apply athreshold
  5. draw a ellipse on it
  6. show the image

Try it out yourself on your favorite LLM (like ChatGPT) by copying the query:

Read an image from a pdf, crop a part of it given by a topleft point plus the width and the height of crop bounding box, then rotate the cropped image, apply a threshold on the image. Finally draw a ellipse on it and show the image.

Using Otary you can do it with few lines of code:

import otary as ot

im = ot.Image.from_pdf(filepath="path/to/you/file.pdf", page_nb=0)

ellipse = ot.Ellipse(foci1=[10, 10], foci2=[50, 50], semi_major_axis=50)

im = (
    im.crop_from_topleft(topleft=[200, 100], width=100, height=100)
    .rotate(angle=90, is_degree=True, is_clockwise=False)
    .threshold_simple(thresh=200)
    .draw_ellipses(
        ellipses=[ellipse],
        render=ot.EllipsesRender(
            is_draw_focis_enabled=True,
            default_color="red"
        )
    )
)

im.show()
  • Otary makes the code much more readable
  • Otary makes the code much more interactive
  • Otary makes libraries management easier by only using one library and not depending on multiple libraries like Pillow, OpenCV, Scikit-Image, PyMuPDF etc.

In a Jupyter notebook, you can easily test and iterate on transformations by simply commenting part of the code as you need it.

im = (
    im.crop_from_topleft(topleft=[200, 100], width=100, height=100)
    # .rotate(angle=90, is_degree=True, is_clockwise=False)
    # .threshold_simple(thresh=200)
    .draw_ellipses(
        ellipses=[ellipse],
        render=ot.EllipsesRender(is_draw_focis_enabled=True)
    )
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otary-0.2.0.tar.gz (76.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otary-0.2.0-py3-none-any.whl (99.5 kB view details)

Uploaded Python 3

File details

Details for the file otary-0.2.0.tar.gz.

File metadata

  • Download URL: otary-0.2.0.tar.gz
  • Upload date:
  • Size: 76.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.1 Linux/6.11.0-1018-azure

File hashes

Hashes for otary-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6711fc709811a4caeec61eb70e2b96031f01f4e3ca0922e50ad559b56ba76322
MD5 ede93d1b31c99abe0d0d1fb022b4f63c
BLAKE2b-256 db28515aceba4b7447c8c8473df1463c5c279bb94351eb111c3fe499c460ef88

See more details on using hashes here.

File details

Details for the file otary-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: otary-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 99.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.1 Linux/6.11.0-1018-azure

File hashes

Hashes for otary-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d568235fb025e8dba300ef1c02abfc61539785eab38bcf47ea35492057881320
MD5 69f9cd58a1880200f6984e87238d34fc
BLAKE2b-256 5ff72c2199af35a8f4e656c24dcbb7ea7a2d63063da0250a5ee3fbb301cf9a68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page