Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python -m pip install -r requirements.txt
```
Then to run the script:
```bash
python script.py --help
python img2braille.py --help
```

## Arguments
Expand All @@ -31,16 +31,16 @@ python script.py --help
| `-b` `--blank` | - | all braille blocks are "full" blocks, in case you only care about the color output and not about the braille pattern |

## Examples
`python script.py 'lain.png' --color ansi --dither --noempty`
`python img2braille.py 'lain.png' --color ansi --dither --noempty`
![image](https://user-images.githubusercontent.com/43345523/143688036-d10ab9b1-4b15-46ac-8796-b80644034d43.png)

`python script.py 'lain.png' --dither`
`python img2braille.py 'lain.png' --dither`
![dither-braille](https://user-images.githubusercontent.com/43345523/124508661-af5d5e80-ddd0-11eb-82cc-256bace864df.png)

`python script.py 'lain.png'`
`python img2braille.py 'lain.png'`
![default-braille](https://user-images.githubusercontent.com/43345523/124508597-8fc63600-ddd0-11eb-93d9-3ede4d521f3b.png)

`python script.py 'lain.png' --noinvert`
`python img2braille.py 'lain.png' --noinvert`
![noinvert-braille](https://user-images.githubusercontent.com/43345523/124508619-9b196180-ddd0-11eb-9def-b906a5e534c4.png)

## How it works:
Expand Down Expand Up @@ -72,7 +72,7 @@ For calculating which braille symbol represents a 2x4 pixel block. The braille s

## How do I save output?
Using the `>` operator, like this:
`python script.py 'lain.png' > output.txt`
`python img2braille.py 'lain.png' > output.txt`

## TODO:
- support for different dithering algorithms
Expand Down
2 changes: 2 additions & 0 deletions script.py → img2braille.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ def iterate_image(img, original_img, dither, autocontrast, noempty, colorstyle,

# Get your output!
iterate_image(img, original_img, args.dither, args.autocontrast, args.noempty, args.color, args.blank)

main = lambda: 0 # Dummy entry point for project.scripts
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "img2braille"
version = "0.0.1"
description = "Turns image into Unicode Braille art."
readme = "README.md"
requires-python = ">=3.8"
license = "GPL-3.0-only"
keywords = [
"art",
"unicode",
"image-processing",
"ascii-art",
"unicode-characters",
"braille-characters",
"utf-16",
"unicode-art",
"braille-art",
]
authors = [
{ name = "TheFel0x", email = "dev.thefel0x@gmail.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"Pillow>=6.2.1",
]

[project.urls]
Documentation = "https://github.com/TheFel0x/img2braille#readme"
Issues = "https://github.com/TheFel0x/img2braille/issues"
Source = "https://github.com/TheFel0x/img2braille"

[project.scripts]
img2braille = "img2braille:main"