Skip to content

Fix truncation of Atkinson and Floyd-Steinberg dithering routines in dithering.js#85

Open
MatrixNeoKozak wants to merge 1 commit into
javl:mainfrom
MatrixNeoKozak:scout-improvement-1780226901581
Open

Fix truncation of Atkinson and Floyd-Steinberg dithering routines in dithering.js#85
MatrixNeoKozak wants to merge 1 commit into
javl:mainfrom
MatrixNeoKozak:scout-improvement-1780226901581

Conversation

@MatrixNeoKozak
Copy link
Copy Markdown

The 'atkinson' and 'bwr_floydsteinberg' branches in ditheringCanvasByPalette are truncated mid-function, causing syntax errors and incomplete pixel value updates. The fix completes the functions to properly apply error diffusion. Also corrects a typo in canvas2bytes where red/green/blue indices were swapped (b, g, b instead of r, g, b), which caused incorrect bit detection.

@javl
Copy link
Copy Markdown
Owner

javl commented May 31, 2026

Please don't create ai generated pull requests without checking the code.

  1. The change to dithering doesn't matter: that entire canvas2bytes() is never even called (I should just take it out)
  2. The second edit (rbg > rgb order) does seem to make sense, I'll look into it
  3. The last part contains errors (ifErr seems to be some sort of copy paste error?), breaking the entire script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants