Zarnevis : RTL Text for your computer vision projects
Installation
The pip way
Just run this on your machine:
pip install zarnevis
The git way
First, clone this repository using this command:
git clone https://github.com/prp-e/zarnevis
Then run these commands:
cd zarnevis && pip install -e .
NOTE: This method is only suggested for when you're going to do some development and tests on the project. If you want to do something else (such as using this tool in a face tracker drone) just use the pip way and don't make trouble for yourself :)
Example
It is pretty straight-forward. I actually made this because I wanted to do some cool stuff and I didn't want to make it so complex. This is an example code:
import cv2
from zarnevis import Zarnevis
image = cv2.imread('example.jpg')
processor = Zarnevis(image=image, text="اهواز زیبا", font_file='vazir.ttf', font_size=36, text_coords=(200,20), color=(255,0,100))
image = processor.draw_text()
cv2.imwrite('example_zarnevis.jpg', image)
Image - Before
Image - After
Special Thanks
- Amin Sharifi - Because he did a great job teaching this method on his website and YouTube channel.
- Touhid Arastu - He pointed out in this issue that in new versions of Pillow, we don't really need reshaping and stuff and if we don't want to run our code on many different platforms, it can handle the thing itself.
Release files for zarnevis 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zarnevis-0.0.1.tar.gz | 2.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zarnevis-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.5 kB
Release files / zarnevis-0.0.1.tar.gz
| Download URL | zarnevis-0.0.1.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e00355d43e9dfe0d5fb9c9b030de1b207c5a04cd228b1037e5aad3b1f8b7a0c1
|
|
BLAKE2b-256 checksum How to use checksums |
4405e236171f1ad07a332321679f03e7b99e4bc810f048d26927f79a4939f712
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.0
|
Release files / zarnevis-0.0.1-py3-none-any.whl
| Download URL | zarnevis-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9dd7648e2df70ff82b2cd31aa313c60b13d8da717d29add276d5ea50aa292585
|
|
BLAKE2b-256 checksum How to use checksums |
4e7ccc0ce72892a5f8c04e44d807e0de6f136e5bde0a3aa88f57a6ebd3681949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.0
|