Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 5, 2022. It is now read-only.
This repository was archived by the owner on Jul 5, 2022. It is now read-only.

166 ASCII Image: charIndex out of bounds for white pixels #3633

Open
@jogerj

Description

in sketch.js, the charIndex of a pixel is calculated as follows:
const charIndex = floor(map(avg, 0, 255, 0, len));
Instead, it should be
const charIndex = floor(map(avg, 0, 256, 0, len));
because otherwise whites (rgb 255, 255, 255) will be mapped to the exact length of the density string which returns '' (an empty string) instead. This results in tearing on videos. The tricky bit was charAt didn't report any error when accessing out of bound index so it went unnoticed.

Nice tutorial btw

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /