How can i get the Pixel Information from a CanvasItem?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CosmicHappiness

Hello, I am trying to make a game where an image appears and the player needs to copy the outline of that image. I am thinking of using a CanvasItem with the draw function for the drawing of the outline. Is there a way to get the pixel data of the CanvasItem at the press of a a button and compare the original image with the player’s drawing?

Or in general, is there a better way to do this please?

Thanks in advance for any responses. :slight_smile:

To compare the outline of an original image with the player’s drawing, we need to know the outline of the original image.

If there aren’t too many originals, and if they all exist before the game begins, then I would manually create an outline image for each original image (outside of Godot, using GIMP or Inkscape).

If there are way too many originals to do manually, or if the originals are generated during the game, then the problem is more complicated.

haydenv | 2022-12-28 10:23