leandrobarone / python-ascii_magic Goto Github PK
View Code? Open in Web Editor NEWConverts pictures into ASCII art
License: MIT License
Converts pictures into ASCII art
License: MIT License
Since there is black/transparent area, the brightness, saturation and etc will look different (e.g. darker) from the original image. Any idea on the correction?
Traceback (most recent call last):
File "convert.py", line 1, in
import ascii_magic
File "/home/gustavo/.local/lib/python3.8/site-packages/ascii_magic/init.py", line 2, in
from PIL import Image, ImageGrab
File "/usr/lib/python3/dist-packages/PIL/ImageGrab.py", line 26, in
raise ImportError("ImageGrab is macOS and Windows only")
ImportError: ImageGrab is macOS and Windows only
hi,
I think the api adress you were using for craiyon is no more working:
When i tried to use your example I had a "JSONDecodeError: Expecting value: line 1 column 1 (char 0)" visibly because the request you use had no answer.
I take a look and the "https://api.craiyon.com/draw" you used is no more existing.
I tried to replace in your code by the old version of Craiyon (https://backend.craiyon.com/generate) and by the new one (https://api.craiyon.com/v3) without success.
But that does not change that i appreciate a lot your library :)
The current behaviour of the optional char argument is to wrap the passed string in a list.
I don't why, but this actually limits the usefulness.
Simply removing the list, allows users to pass a string with the set of chars they wish to use.
Simply change
chars = [char] if char else CHARS_BY_DENSITY
To
chars = char if char else CHARS_BY_DENSITY
Strings are already iterable in python. This is also the current behaviour if char is None (CHARS_BY_DENSITY
is just a string with all characters to be used).
Empty strings (''
) evaluate to False, while strings with contents evaluate to True:
>>> test1 = ''
>>> test2 = '1'
>>> if test1: print(test1)
...
>>> if test2: print(test2)
...
1
>>>
It would be very helpful if you could tag releases as well. This would enable distributions who want to run your tests to fetch the package from GitHub instead of PyPI, where the tests are excluded.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.