implement Floyd-Steinberg and Atkinson dithering functions - #30
Open
Kimmicorn-glitch wants to merge 19 commits into
Open
implement Floyd-Steinberg and Atkinson dithering functions#30Kimmicorn-glitch wants to merge 19 commits into
Kimmicorn-glitch wants to merge 19 commits into
Conversation
- All tests passing
…rectly - Added auto-scaling of pixel brightness so full ASCII range is used - Properly handles completely black or white images to map to darkest/lightest characters - Preserves aspect ratio and width parameter - Ensures unit tests pass
…maintain aspect ratio and map pixels to ASCII based on brightness
Owner
|
i like what you did here but i have some improvements id like you to make that kind of go agains what i asked in the issue but i think itll improve the program, for the implementation, since dithering is modifying the image itself, if the dithering function is called it should dither the image beforehand then pass the dithered image to whatever ascii conversion method is used. |
Contributor
Author
|
Thank you for the feedback, I understand what you mean about calling the
dithering function first so it modifies the image before passing it to the
ASCII conversion. I’m happy to work on implementing it this way. I'll do it now.
…On Tue, 21 Oct 2025, 13:25 Nathan, ***@***.***> wrote:
*Nate534* left a comment (Nate534/image_to_ascii#30)
<#30 (comment)>
i like what you did here but i have some improvements id like you to make
that kind of go agains what i asked in the issue but i think itll improve
the program, for the implementation, since dithering is modifying the image
itself, if the dithering function is called it should dither the image
beforehand then pass the dithered image to whatever ascii conversion method
is used
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BVVD73GWBA7FN5JN3CFGRWT3YYJZHAVCNFSM6AAAAACJYUGPBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMRWGA4TMOBWGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Author
|
Hi Nathan, I updated the flow so that if dithering is enabled, the image
gets dithered right after resizing and before the ASCII conversion starts.
Just want to confirm this matches what you meant, that the dithering should
happen beforehand, not after?
On Tue, Oct 21, 2025 at 1:52 PM Kimberley Bezuidenhout <
***@***.***> wrote:
… Thank you for the feedback, I understand what you mean about calling the
dithering function first so it modifies the image before passing it to the
ASCII conversion. I’m happy to work on implementing it this way, would you
like me to handle it in this current issue after your changes, or would it
make more sense for me to focus on the new issue instead?
On Tue, 21 Oct 2025, 13:25 Nathan, ***@***.***> wrote:
> *Nate534* left a comment (Nate534/image_to_ascii#30)
> <#30 (comment)>
>
> i like what you did here but i have some improvements id like you to make
> that kind of go agains what i asked in the issue but i think itll improve
> the program, for the implementation, since dithering is modifying the image
> itself, if the dithering function is called it should dither the image
> beforehand then pass the dithered image to whatever ascii conversion method
> is used
>
> —
> Reply to this email directly, view it on GitHub
> <#30 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BVVD73GWBA7FN5JN3CFGRWT3YYJZHAVCNFSM6AAAAACJYUGPBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMRWGA4TMOBWGE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Owner
|
sorry i did accept a new pull request would you mind updating your implementation so there aren't any merge conflicts |
Contributor
Author
|
Sure, no problem.
…On Tue, 21 Oct 2025, 16:43 Nathan, ***@***.***> wrote:
*Nate534* left a comment (Nate534/image_to_ascii#30)
<#30 (comment)>
sorry i did accept a new pull request would you mind updating your
implementation so there aren't any merge conflicts
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BVVD73EUDSAYQPUPQSPCPG33YZBCHAVCNFSM6AAAAACJYUGPBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMRXGA3DMNRXHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Author
|
Afternoon Nathan, Apologies I see the merge conflicts will sort it out
On Tue, 21 Oct 2025, 17:20 Kimberley Bezuidenhout, <
***@***.***> wrote:
… Sure, no problem.
On Tue, 21 Oct 2025, 16:43 Nathan, ***@***.***> wrote:
> *Nate534* left a comment (Nate534/image_to_ascii#30)
> <#30 (comment)>
>
> sorry i did accept a new pull request would you mind updating your
> implementation so there aren't any merge conflicts
>
> —
> Reply to this email directly, view it on GitHub
> <#30 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BVVD73EUDSAYQPUPQSPCPG33YZBCHAVCNFSM6AAAAACJYUGPBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMRXGA3DMNRXHE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
… maintain docstrings and thumbnail/gallery generation
…d tiny image handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces two dithering methods:
Floyd–Steinberg and Atkinson to improve the visual quality of ASCII art. Dithering reduces banding artifacts and creates smoother gradients when converting images to ASCII.
Changes included:
Added dithering.py with floyd_steinberg_dither and atkinson_dither functions.
Updated ascii_conversion.py and brightness converter to accept optional dithering.
CLI now supports : dithering argument (none, floyd, atkinson).
Unit tests for dithering functions added and all tests passing.