Image and 2D Geometry library for easy and fast image manipulation
Project description
Otary library, readable, fast, unified, interactive, flexible, pythonic
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:
- read an image from a pdf file
- crop a part of it
- rotate the cropped image
- apply athreshold
- draw a ellipse on it
- 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)
)
)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file otary-0.1.2.tar.gz.
File metadata
- Download URL: otary-0.1.2.tar.gz
- Upload date:
- Size: 75.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8edfcecc18fd16910f4711b81aa9644a0dee35cd834490254543a2fdfa8c023
|
|
| MD5 |
a2469b6b4643734ed4d63963835e7b71
|
|
| BLAKE2b-256 |
57ef528f599744e2ebe021e79979860829780423fbbd989a5f814f423e2e10bf
|
File details
Details for the file otary-0.1.2-py3-none-any.whl.
File metadata
- Download URL: otary-0.1.2-py3-none-any.whl
- Upload date:
- Size: 98.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ee34a601cb466ed64dc6e4ea40f84e3655818da175d67505f286bfc44b575fd
|
|
| MD5 |
0543a7bddd68246199dfe5250d50cc05
|
|
| BLAKE2b-256 |
6cce8f0b64b1ad6cdad66cefb5a245303d38b120138121d325f2efefdfa2ce93
|