Present Characters as Pixel Emoji
Project description
Nazli - Word to Pixel Emoji
This Python project converts text into pixel-art-style emojis, transforming each character into a creative and visually appealing grid of emojis.
Features
- Pixel Art Transformation: Converts words into pixel-art-style emoji grids.
- Customizable Emojis: Choose your own emojis for the "filled" and "empty" parts of the pixel art.
- Flexible Input: Handles multi-character words and adjusts spacing based on emoji width.
- Simple Integration: Designed for easy integration into larger projects or standalone use.
Usage
-
Clone the repository:
git clone https://github.com/kamyarmg/nazli.git cd nazli
-
Import the module into your project:
from nazli import word_to_pixel_emoji print(word_to_pixel_emoji("I", filled_emoji="๐บ")) print(word_to_pixel_emoji("Wish", filled_emoji="๐ธ")) print(word_to_pixel_emoji("You", filled_emoji="๐ง")) print(word_to_pixel_emoji("The", filled_emoji="๐")) print(word_to_pixel_emoji("Best.", filled_emoji="๐"))
Output Example:
๐บ๐บ๐บ
๐บ
๐บ
๐บ
๐บ๐บ๐บ
๐ธ ๐ธ ๐ธ๐ธ๐ธ ๐ธ๐ธ๐ธ๐ธ ๐ธ ๐ธ
๐ธ ๐ธ ๐ธ ๐ธ ๐ธ ๐ธ
๐ธ ๐ธ ๐ธ ๐ธ ๐ธ๐ธ๐ธ ๐ธ๐ธ๐ธ๐ธ๐ธ
๐ธ๐ธ ๐ธ๐ธ ๐ธ ๐ธ ๐ธ ๐ธ
๐ธ ๐ธ ๐ธ๐ธ๐ธ ๐ธ๐ธ๐ธ๐ธ ๐ธ ๐ธ
๐ง ๐ง ๐ง๐ง๐ง ๐ง ๐ง
๐ง ๐ง ๐ง ๐ง ๐ง ๐ง
๐ง ๐ง ๐ง ๐ง ๐ง
๐ง ๐ง ๐ง ๐ง ๐ง
๐ง ๐ง๐ง๐ง ๐ง๐ง๐ง
๐๐๐๐๐ ๐ ๐ ๐๐๐๐๐
๐ ๐ ๐ ๐
๐ ๐๐๐๐๐ ๐๐๐๐
๐ ๐ ๐ ๐
๐ ๐ ๐ ๐๐๐๐๐
๐๐๐๐ ๐๐๐๐๐ ๐๐๐๐ ๐๐๐๐๐
๐ ๐ ๐ ๐ โ ๐
๐๐๐๐ ๐๐๐๐ ๐๐๐ ๐
๐ ๐ ๐ ๐ ๐
๐๐๐๐ ๐๐๐๐๐ ๐๐๐๐ ๐ ๐
Key Functions
-
word_to_pixel_emoji(word: str, filled_emoji: str = "๐ธ") -> str-
Converts a word into a grid of pixel emoji art.
-
Parameters:
word: The text to convert.filled_emoji: The emoji to use for the filled portions of the grid (default: ๐ธ).
-
Returns:
- A string containing the pixel-art emoji representation of the word.
-
-
char_to_pixel_emoji(char: str, filled_emoji: str, empty_emoji: str) -> list[str] | None- Converts a single character to a pixel-art representation.
- Returns
Noneif the character is not in the pixel map.
-
emoji_length(emoji: str) -> int- Calculates the visual width of an emoji based on its Unicode properties.
Pixel Map
The pixel map for each character is stored in PIXEL_MAP and defines how each letter is visualized. You can customize this mapping by updating the pixel_art.py module.
Example Mapping
PIXEL_MAP = {
"A": [
" X ",
" X X ",
"XXXXX",
"X X",
"X X",
],
# Add more characters...
}
Contributing
Contributions are welcome! Feel free to submit issues or pull requests to enhance the functionality or add support for additional features. For more information, please see the CONTRIBUTING.md
Project details
Release history Release notifications | RSS feed
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 nazli-1.0.0.tar.gz.
File metadata
- Download URL: nazli-1.0.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
243626044a1635db2deeb26df34ab26555c984773cbb79c7a51ec9b1b10f9a97
|
|
| MD5 |
c57072a52faa5bf74c01c5bdbab418cb
|
|
| BLAKE2b-256 |
c6ce6677bc35661dcff969a90861415a14ee799a0f05540a74fe68c89ea8e2fb
|
File details
Details for the file nazli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: nazli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bff49f0fc64ba39df8fea977e803ef439a16ad5334e13247a4350deefcf273b
|
|
| MD5 |
2944cbb3b038664204fda7dab2fad2b4
|
|
| BLAKE2b-256 |
ade6ec39d974d0906ca2e005216c36f15a0294673396568e055676d624faba37
|