Skip to content

Output 1D Unknown-Length Array from 2D Known-Length Array #805

Description

@c4b4d4

I'm trying to generate an unknown-length array, from an input image or 2D array.

I want to distribute data using a noise image, for example:

For every white pixel -> Save the position of it (x, y) and push it to an array so you end up having a Z-length array. Where Z is the number of white pixels in the noise image.

Input

Screenshot 2022-12-28 at 17 08 45

Output

[[x1, y1], [x2, y2], .... [xZ, yZ]]

In result I get all the locations of where a pixel is white.

I need to use GPU power, since noise images are huge in my use case and must be updated at least at 24 fps.

Doing math

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions