Cursor Project Practice-01: Screenshot to GIF Conversion for Specified Screen Areas
Project Description
This is a practice project using cursor, implemented in Python, designed to convert screen captures into GIF images for result demonstration or examples.
Result Demonstration
Prerequisites
-
Cursor
- Version: 1.2.1
- Cursor rules: Cursor Rules
- Agent: claude-4-sonnet-thinking
-
Overall Workflow
- Set cursor rules → Describe requirements → Cursor coding → Git version control → Debugging output
Project Steps
- Organize requirements and have cursor generate project structure. Requirements as follows:
## Develop a Python program to convert screen captures into GIF images
1. The program should capture specified screen areas (selected via mouse drag) and save images in webp format
2. Compress images and generate GIF files
3. Include an interface for setting compression ratio, frame rate, and save path
## Requirements
1. Only essential features, no additional functionality
2. Note screen scaling ratio as I'm using a Mac computer
-
Establish project structure by inputting requirements:
Analyze the requirement.md documents and start project writing
-
Generate project documentation
- Set up virtual environment and install dependencies
- Complete basic framework and interface functionality
- Region selection feature incomplete. Continue implementation
- Feature completed
- Generated images too large. Continue optimization
Issue Log
-
Issue 1
- Problem: Region selection was command-line based rather than graphical interface.
- Solution: Directly instructed cursor to modify, specifying need for GUI
-
Issue 2
- Problem: Requirements description wasn't precise enough, leading to feature creep
- Solution: Added appropriate context and more accurate feature descriptions
-
Issue 3
- Problem: Significant difference between claude-4-sonnet and claude-4-sonnet-thinking. Former took an hour without resolution, latter solved in 3 requests within 5 minutes.
- Solution: Prefer thinking version for complex problems or solution analysis
Usage Insights
- Added date acquisition in rules to prevent model from using only its internal date reference.
- For Python programs, added virtual environment creation in rules to prevent multi-project environment conflicts