Room Generation from Image - "Read pixels" Extension (Usage)

Hello community!

I’m creating a 2D room generation system in GDevelop where the layout is defined by a “blueprint” image (e.g., 11x11 pixels), with colors representing different tiles (wall, floor, etc.).

My goal is to:

  • Load the “blueprint” image into a Sprite object (RoomBlueprint).
  • Iterate through each pixel of the blueprint.
  • Read the RGB color of each pixel using the “Read pixels” extension.
  • Based on the color, create the corresponding tile (e.g., WallTile, FloorTile) at the correct coordinates.

My main question is: Can the “Read pixels” extension be used to implement this room generation system as I described? If so, what is the correct and complete syntax for reading the RGB (Red, Green, Blue) values of a specific pixel from a Sprite object using this extension?

Any help or event examples would be greatly appreciated!

Thank you!

The extension only allow to read pixel that are displayed on screen. With JavaScript, it’s possible to read the pixels of a given image resource.

If you don’t know how to code, you might find someone interested by the idea. It won’t be easy since there is a bit of memory management to do to make it efficient.
You could open a feature request in the extension category and see:

I guess a workaround would be to display the sprite on screen of only 1 frame, but it may not look great if it does some kind of flash.