Search⌘ K
AI Features

Completing the App: Gallery and PNG Export

Explore how to complete a pixel art canvas application by adding a gallery page to browse saved artworks and a download feature to export pixel art as PNG files. Learn to integrate these features using Flask, SQLite, and Codex prompts, including automated test updates for robust functionality.

The drawing and saving feature is working. We can paint on a 32x32 grid, choose a colour from the palette, give our canvas a name, and save it to the database. What we cannot do yet is view any of those saved canvases or get them out of the app as image files. In this lesson we complete the build with two more feature:

  1. Adding a gallery page where every saved canvas appears with a pixel preview, its name, and the date it was saved.

  2. Adding a Download button to each gallery card that generates and downloads a PNG file of the artwork.

Once both features are implemented, the app is fully working end to end.

Adding a gallery page

Now we will ask Codex to add the gallery page. The drawing page already has a way to save canvases, so this task is about giving us somewhere to browse them. We describe the page from the user’s perspective and let Codex handle the structure. Here is the prompt:

Prompt: Add a gallery page that ...