Skip to content

AI-powered scratch-to-reveal game: Snap a photo, listen to ambient sounds, generate magical images!

Notifications You must be signed in to change notification settings

sunilpalacherla/ScratchLens

Repository files navigation

ScratchLens 🎨✨

A fun "scratch-to-reveal" mobile app that uses AI to generate personalized images based on what your camera sees and microphone hears in real-time.

🌟 Features

  • Real-time Capture: Simultaneously records 5 seconds of ambient audio and captures a photo
  • AI Processing: Uses AI to transcribe audio and analyze visual scenes
  • Creative Generation: Combines audio and visual inputs to create unique, magical AI images
  • Scratch Reveal: Interactive scratch-to-reveal interface with metallic effect
  • Sharing: Share your AI creations with friends via social media
  • Cross-platform: Works on both iOS and Android

🚀 Quick Start

Prerequisites

  • Flutter SDK (3.0 or higher)
  • Android Studio / Xcode for iOS development
  • For iOS: CocoaPods installed

Installation

  1. Clone the repository

    git clone <repository-url>
    cd scratchlens
  2. Install dependencies

    flutter pub get
  3. For iOS (macOS only)

    cd ios
    pod install
    cd ..
  4. Run the app

    flutter run

Permissions Required

The app requires the following permissions:

  • Camera: To capture photos of your surroundings
  • Microphone: To record ambient sounds
  • Storage: To save and share generated images

🏗️ Architecture

Tech Stack

  • Framework: Flutter
  • State Management: Provider
  • Camera: camera plugin
  • Audio Recording: record plugin
  • Scratch Effect: flutter_scratch_card
  • Sharing: share_plus

Project Structure

lib/
├── main.dart              # App entry point
├── screens/
│   ├── home_screen.dart   # Welcome screen
│   ├── capture_screen.dart # Recording & processing
│   └── reveal_screen.dart # Final result & sharing
├── services/
│   ├── camera_service.dart # Camera management
│   ├── audio_service.dart  # Audio recording
│   └── ai_service.dart     # AI processing (mock for MVP)
├── widgets/
│   └── scratch_card.dart   # Scratch-to-reveal widget
└── models/                 # Data models (future use)

🤖 AI Integration (MVP Version)

Currently uses mock AI services for demonstration. To integrate real AI:

Audio Transcription

Replace AIService.transcribeAudio() with:

  • Whisper (OpenAI) - on-device or API
  • Google Speech-to-Text
  • Azure Speech Services

Image Analysis

Replace AIService.describeImage() with:

  • CLIP Interrogator
  • Google Vision AI
  • Azure Computer Vision

Image Generation

Replace AIService.generateImage() with:

  • Flux Schnell (via Replicate/Fal)
  • Stable Diffusion XL Lightning
  • DALL-E or Midjourney APIs

📱 Example Experiences

  • Beach: Waves + seagulls + sand → Majestic dolphin jumping at sunset
  • Café: Coffee machine + chatter + pastries → Giant croissant with sunglasses
  • With Dog: Barking + pet → Dog as flying superhero
  • Rainy Street: Rain + cars + umbrellas → Cyberpunk neon city reflection

🎯 Monetization Ideas

  • Free tier: 5 scratches/day
  • Premium: Unlimited scratches + higher quality AI
  • Cosmetic effects: Gold, rainbow, fire scratch effects
  • Remix feature: Regenerate with different styles
  • Subscription: $5-8/month for pro features

🛠️ Development

Adding New AI Services

  1. Create new service class in lib/services/
  2. Update AIService to use real API endpoints
  3. Add API keys to environment variables
  4. Update error handling and loading states

Customizing UI

  • Colors: Update gradients in theme
  • Animations: Modify animation controllers
  • Effects: Customize scratch card appearance

📄 License

This project is open source and available under the MIT License.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Contact

For questions or support, please open an issue on GitHub.


Made with ❤️ and AI magic ✨

About

AI-powered scratch-to-reveal game: Snap a photo, listen to ambient sounds, generate magical images!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published