timfi / dotmatrix Goto Github PK
View Code? Open in Web Editor NEWA dot matrix rendered using braille characters.
Home Page: https://pypi.org/project/dotmatrix/
License: GNU General Public License v2.0
A dot matrix rendered using braille characters.
Home Page: https://pypi.org/project/dotmatrix/
License: GNU General Public License v2.0
It would be nice to be able to rotate/transpose/crop/shift/etc. any give matrix.
from dotmatrix import Matrix
m = Matrix(5, 5)
print("Initial")
m.polygon((0, 0), (0, 4), (4, 4))
print(m.render())
print("Transposed")
m.transpose()
print(m.render())
Initial
⡗⢄⠀
⠉⠉⠁
Transposed
⠙⢍⡇
⠀⠀⠁
No response
One "nice to have" feature could be the addition of matrices that use other character sets for rendering. One nice set could be ▖▗▘▝▀▄▌▐▚▞▙▛▜▟█
, i.e. a 2x2 grid per character.
This could be accomplished by extracting all the character set dependent code into a subclass and leave an ABC that makes use of __getitem__
, __setitem__
, __init__
, and render
provided by the subclass.
from dotmatrix import BlockMatrix
m = BlockMatrix(16, 8)
m.rectangle((0, 0), (15, 7))
print(m.render())
▛▀▀▀▀▀▀▜
▌ ▐
▌ ▐
▌ ▐
▌ ▐
▌ ▐
▌ ▐
▙▄▄▄▄▄▄▟
No response
As you mentioned in reddit post, pictures of matrix can be broken due to browsers "smart" behaviour. This problem is on README too
Not the code, only ask for use picture in README
Will add picture in "Anything else?" section as I am not certain in posting picture here
An amazing feature would be the ability to render a given image onto a dotmatrix. And to make things prettier some sort of dithering, be it Floyd-Steinberg or Atkinson or something else entirely, would also be nice.
import dotmatrix as dm
m = dm.Matrix(256, 256)
m.blit(
"path/to/my/image",
area=((63, 63), (191, 191)), # The area to blit the image to.
dither=dm.dither.Floyd # The dithering algorithm to use.
)
print(m.render())
or
import dotmatrix as dm
from PIL import Image
m = dm.Matrix(256, 256)
img = Image.open("path/to/my/image")
m.blit(
img,
area=((63, 63), (191, 191)), # The area to blit the image to.
dither=dm.dither.Floyd # The dithering algorithm to use.
)
print(m.render())
No response
Example: DotArt by Garrett Albright
The latter example usage would require pillow as dependency. Thus it might be sensible to block this feature behind an "import guard" and add pillow as an extra-install-option, àla dotmatrix[images]
.
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.