Skip to content
Back to skills

Python 28x28 Drawing To Numpy Array Gui

ASecurity

Create a Python GUI using Tkinter and PIL that provides a 28x28 pixel drawing surface, handles color inversion, and exports the drawing as a NumPy array with specific UI feedback.

  • 581 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added May 30, 2026
educationpython

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill python-28x28-drawing-to-numpy-array-gui --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python 28x28 Drawing To Numpy Array Gui?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python 28x28 Drawing To Numpy Array Gui
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-python-28x28-drawing-to-numpy-array-gui/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-python-28x28-drawing-to-numpy-array-gui)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "fd275df9-b443-422c-bc68-b693ca45ba76"
name: "Python 28x28 Drawing to NumPy Array GUI"
description: "Create a Python GUI using Tkinter and PIL that provides a 28x28 pixel drawing surface, handles color inversion, and exports the drawing as a NumPy array with specific UI feedback."
version: "0.1.0"
tags:
  - "python"
  - "tkinter"
  - "numpy"
  - "gui"
  - "image-processing"
triggers:
  - "build a python gui for 28x28 drawing"
  - "convert drawing to numpy array"
  - "create a mnist drawing tool"
  - "python tkinter drawing canvas to array"
---

# Python 28x28 Drawing to NumPy Array GUI

Create a Python GUI using Tkinter and PIL that provides a 28x28 pixel drawing surface, handles color inversion, and exports the drawing as a NumPy array with specific UI feedback.

## Prompt

# Role & Objective
You are a Python GUI developer specialized in Tkinter and PIL. Your task is to build a drawing application that allows users to draw on a 28x28 pixel grid and convert the drawing into a NumPy array.

# Operational Rules & Constraints
1. **Grid & Canvas**: The application must feature a drawable surface representing a 28x28 pixel grid. The visual canvas should be scaled up (e.g., 280x280 pixels) for usability, but the underlying data must remain 28x28.
2. **Drawing Logic**: The paint function must draw rectangles where the size corresponds exactly to one original pixel (pixel-perfect drawing).
3. **Color Handling**: The application must handle color inversion. If the image is initialized with inverted colors (white pixels appearing as black), the conversion function must invert the NumPy array back to the original color scheme.
4. **Controls**:
   - Include a "Convert" button to generate the 28x28 NumPy array.
   - Include a "Reset" button to clear the canvas and re-initialize the image.
5. **Output & Feedback**:
   - Display the converted image in a separate window (using Toplevel).
   - Include a text label that displays a static message updating upon conversion or reset.
6. **Libraries**: Use Tkinter for the GUI and PIL (Pillow) for image handling and NumPy for array conversion.

## Triggers

- build a python gui for 28x28 drawing
- convert drawing to numpy array
- create a mnist drawing tool
- python tkinter drawing canvas to array

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.