Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Dithered Images #3

Open
timfi opened this issue Aug 16, 2021 · 0 comments
Open

Feature Request: Dithered Images #3

timfi opened this issue Aug 16, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@timfi
Copy link
Owner

timfi commented Aug 16, 2021

Description

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.

Code

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())

Output

No response

Anything else?

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].

@timfi timfi added the enhancement New feature or request label Aug 16, 2021
@timfi timfi self-assigned this Aug 16, 2021
@timfi timfi changed the title Feature Request: Image Dithering Feature Request: Dithered Images Aug 16, 2021
@timfi timfi removed their assignment Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant