AWS Builder Center
Building an AI-Powered Screenshot Organizer: How Kiro Turned Days into Hours

Building an AI-Powered Screenshot Organizer: How Kiro Turned Days into Hours

*A Week 2 submission for the AI for Bharat Hackathon by Hack2Skill and AWS

The Problem: Screenshot Chaos

Like many developers, I take dozens of screenshots daily - code snippets, error messages, memes, documentation. Within days, my Downloads folder becomes a graveyard of files named  Screenshot_20251205_143022.png  with no indication of what's inside.
Finding that one screenshot from last week? Good luck.
I was spending 10-15 minutes every week just searching for old screenshots. That's when I decided: "I hate doing this, so I'm going to automate it."



The Solution: AI That Understands Content

Instead of organizing by filename patterns (which don't work for generic names), I built a tool that reads and understands screenshot content using AI.

What It Does:

  • Analyzes screenshot content using OCR + CLIP vision models
  • Automatically categorizes into folders (Code, Memes, Documents, etc.)
  • Generates descriptive filenames based on content
  • Runs completely offline - no API costs
  • Fully customizable for any workflow

Tools Used

  • CLIP (ViT-B/32): For fast image classification.
  • Python: Core scripting language.
  • Torch + PIL: For model inference and image handling.
  • Standard libraries:  os ,  glob ,  shutil ,  datetime 

The Result:

Before:
Plain text
Downloads/
├── Screenshot_20251201_143022.png
├── Screenshot_20251201_143045.png
├── Screenshot_20251202_091234.png
... (50+ more generic names)
After:
Plain text
Organized_Screenshots/
├── Code/
│ └── 2025-12/
│ ├── python_function_hello_world_2025-12-05.png
│ └── javascript_react_component_2025-12-05.png
├── Memes/
│ └── 2025-12/
│ └── funny_cat_programming_2025-12-05.png
└── Documents/
└── 2025-12/
└── aws_documentation_guide_2025-12-05.png



How It Works: The AI Pipeline

The magic happens through a hybrid approach combining two AI models:

1. OCR (Optical Character Recognition)

Extracts text from screenshots to identify content:
Python
def extract_text_ocr(self, image_path):
"""Extract text from screenshots with text content"""
result = self.ocr_reader.readtext(str(image_path), detail=0)
text = ' '.join(result).lower()
return text

2. CLIP (Vision-Language Model)

Analyzes visual content to understand images:
Python
def classify_with_clip(self, image_path):
"""CLIP understands visual content through text descriptions"""
# Create prompts: "a screenshot of code", "a screenshot of memes", etc.
texts = [f"a screenshot of {cat.lower()}" for cat in categories]

# CLIP matches image with text descriptions
outputs = self.clip_model(**inputs)
probs = outputs.logits_per_image.softmax(dim=1)

return best_category, confidence_score

3. Smart Decision Making

Combines both for maximum accuracy:
Python
def determine_category(self, image_path):
"""Hybrid approach for best accuracy"""
# Step 1: OCR extracts text and matches keywords
ocr_text = self.extract_text_ocr(image_path)
ocr_category = self.match_keywords(ocr_text)

# Step 2: CLIP analyzes visual content
clip_category, confidence = self.classify_with_clip(image_path)

# Step 3: Smart combination
if ocr_category and clip_category:
if ocr_category == clip_category:
return ocr_category # Both agree - high confidence!
elif confidence < 0.5:
return ocr_category # Trust OCR keywords
else:
return clip_category # Trust CLIP's confidence
# ... handle other cases
Example Flow:
Plain text
Screenshot with Python code
↓
OCR: "def hello_world print python"
↓
CLIP: "This looks like code" (95% confidence)
↓
Both agree → Category: "Code"
↓
Output: Code/2025-12/python_function_2025-12-05.png



How Kiro Accelerated Development

This is where things get interesting. What would typically take 2-3 days was completed in 4-5 hours thanks to Kiro AI IDE.

1. Rapid Prototyping

Traditional Approach:
  • Research libraries: 1 hour
  • Write boilerplate: 2 hours
  • Debug integration: 2-3 hours
  • Write documentation: 1-2 hours
  • Total: 6-8 hours minimum
With Kiro: I described what I wanted to build, and Kiro:
  • Suggested optimal libraries (EasyOCR + Transformers)
  • Generated production-ready code with error handling
  • Created comprehensive documentation automatically
  • Total: ~30 minutes

2. Intelligent Code Generation

Kiro didn't just generate basic code - it created production-quality implementations with:
Python
def initialize_models(self):
"""Initialize AI models with proper error handling"""
try:
from transformers import CLIPProcessor, CLIPModel
import torch

self.clip_model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")

# Auto-detect GPU availability
self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.clip_model.to(self.device)
print(f"✅ CLIP loaded on {self.device}")

except Exception as e:
print(f"⚠️ CLIP loading failed: {e}")
print("💡 Install with: pip install transformers torch")
self.clip_model = None
What Kiro got right:
  • ✅ Proper error handling with helpful messages
  • ✅ GPU auto-detection for performance
  • ✅ Lazy loading for memory efficiency
  • ✅ User-friendly installation hints


3. Iterative Refinement

When I asked for improvements, Kiro understood context immediately:
Me: "Can you add both "one-time" and "--watch" mode in the same script?"
Kiro: Instantly added command-line argument parsing:
Python
parser = argparse.ArgumentParser(description='AI-Powered Screenshot Organizer')

parser.add_argument('--watch', '-w', action='store_true',
help='Watch mode: continuously monitor new screenshots')
parser.add_argument('--source', '-s',
help='Source folder to organize')

# Now supports both modes:
# python organize_screenshots.py # One-time
# python organize_screenshots.py --watch # Continuous

4. Multiple Deployment Options

Me: "Can I run the script on Google Colab ?"
Kiro: Immediately created:
  • A Colab-ready Jupyter notebook
  • Environment auto-detection
  • Separate documentation for both platforms
Python
# Auto-detect environment
IS_COLAB = 'COLAB_GPU' in os.environ

if IS_COLAB:
print("Colab mode: Upload images or use Drive")
else:
print("Local mode: Using configured paths")

5. Comprehensive Documentation

Kiro automatically generated:
  •  README.md  - Complete project documentation
  •  QUICK_START.md  - Getting started guide
  •  CONFIG_EXPLAINED.md  - Customization guide
  •  COLAB_GUIDE.md  - Colab setup instructions
Each document was well-structured, included code examples, and had troubleshooting tips.




Performance & Results

Testing Environment:

  • Local PC: Intel i3 7th Gen, 8GB RAM (CPU only)
  • Google Colab: Free tier with T4 GPU

Performance Metrics:

Environment
Speed per Image
100 Screenshots
Colab (GPU)
0.5-1 sec
~2 minutes
Local (CPU)
2-5 sec
~10 minutes

Accuracy Results:

Tested on 50 diverse screenshots:
  • Overall Accuracy: 92%
  • Code Screenshots: 98% (OCR keywords very reliable)
  • Memes/Images: 88% (CLIP visual analysis)
  • Documents: 94% (OCR text extraction)




Easy Customization

One of the best features is how easy it is to customize for your specific needs:

For Students:

JSON
{
"categories": {
"Assignments": ["assignment", "homework", "due", "submit"],
"Lectures": ["lecture", "slide", "professor", "notes"],
"Code": ["python", "java", "programming"],
"Research": ["paper", "research", "study"]
}
}

For Developers:

JSON
{
"categories": {
"Code": ["function", "class", "import", "def"],
"Errors": ["error", "exception", "traceback", "bug"],
"Documentation": ["docs", "readme", "api"],
"Design": ["figma", "ui", "mockup"]
}
}
How it works:
  1. OCR extracts text from screenshot
  1. Searches for your keywords
  1. CLIP confirms with visual analysis
  1. Categorizes accordingly




Getting Started

Quick Start on Google Colab:

Python
# 1. Install dependencies
!pip install -q transformers torch pillow easyocr

# 2. Upload the script and config
from google.colab import files
uploaded = files.upload()

# 3. Upload test screenshots
test_images = files.upload()

# 4. Run the organizer
!python organize_screenshots.py

# 5. Download results
!zip -r organized.zip Organized_Screenshots/
files.download('organized.zip')

Install Locally:

Bash
# Clone the repository
git clone [your-repo-url]
cd screenshot-organizer

# Install dependencies (~2-3 GB download)
pip install -r requirements.txt

# Run on current folder
python organize_screenshots.py

# Or organize Downloads folder
python organize_screenshots.py --source ~/Downloads

# Watch mode for continuous organization
python organize_screenshots.py --watch --source ~/Downloads



Key Takeaways

1. Kiro Dramatically Accelerates Development

  • 80%+ time savings on this project
  • Production-quality code from the start
  • Comprehensive documentation automatically generated
  • Multiple deployment options without extra effort

2. Hybrid AI Approaches Work Best

  • OCR excels at text-heavy screenshots
  • CLIP handles visual content
  • Combining them covers all cases

3. Offline AI is Practical

  • No API costs (important for personal projects)
  • Complete privacy (screenshots never leave your machine)
  • Works without internet
  • One-time setup, unlimited use

4. Solving Real Problems is Satisfying

This isn't just a hackathon project - it's a tool I'll use daily. That's the best kind of automation.



Impact

Development Metrics:

  • Traditional approach: 2-3 days
  • With Kiro: 4-5 hours
  • Time saved: 80%+
  • Lines of code: ~500
  • Documentation files: 8

Real-World Impact:

  • Time saved per week: 10-15 minutes
  • Time saved per year: ~8-10 hours
  • Cost: $0 (no API fees)
  • Privacy: 100% local processing



Conclusion

The "Lazy Automation" theme of this hackathon challenge resonated with me because we all have these repetitive tasks we hate doing. With AI and tools like Kiro, we can automate them faster than ever before.
What I learned:
  1. AI-assisted development is a game changer
  1. Kiro doesn't just speed up coding - it improves code quality
  1. Hybrid AI approaches (OCR + CLIP) are powerful
  1. Offline AI is practical and cost-effective
  1. Good documentation matters (and Kiro generates it automatically)
The best part? This isn't just a demo - it's a tool that solves a real problem I face every day.



Resources




About This Project

Built for the AI for Bharat Hackathon - Week 2: Lazy Automation challenge by Hack2Skill and AWS. The complete source code, documentation, and Colab notebook are available on GitHub.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article