Skip to content

sms03/Poke-Sprites

Repository files navigation

🔥 Pokémon Sprite Renderer 🔥

Gotta Render 'Em All!

Python 3.8+ License: MIT Pokemon: Animated


✨ Features

  • 📥 Download animated Pokémon sprites from PokéAPI
  • 🖼️ View animated GIF sprites with proper timing
  • 🛠️ Multiple renderer implementations (Pygame, Tkinter, Matplotlib)
  • 🖱️ Simple drag-and-drop interface (in some implementations)
  • ⌨️ Keyboard shortcuts for quick sprite selection
  • 🔄 Proper animation timing from the original GIFs

🔥 Charizard Spotlight 🔥

Charizard, the iconic Fire/Flying-type Pokémon (#6 in the Pokédex), is a fan favorite and the star of this renderer! With its majestic wings and flaming tail, Charizard represents the power and beauty of Pokémon animation.


Normal

Shiny

View Charizard in all its animated glory with:

python pokemon_sprite_renderer.py sprites/6.gif

🚀 Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/poke-sprites.git
    cd poke-sprites
    
  2. Set up a virtual environment (recommended):

    python -m venv poke
    
  3. Activate the virtual environment:

    • Windows: poke\Scripts\activate
    • macOS/Linux: source poke/bin/activate
  4. Install the dependencies:

    pip install -r requirements.txt
    

📋 Usage

📥 Downloading Sprites

Use the download_sprites.py script to download Pokémon sprites:

# Download the first 25 Pokémon
python download_sprites.py --range 1-25

# Download specific Pokémon by ID
python download_sprites.py 1 4 7 25

# Download sprites to a custom directory
python download_sprites.py --range 1-151 --output mypokemon

# Download Charizard (of course!)
python download_sprites.py 6

👁️ Viewing Sprites

The project includes multiple implementations for viewing sprites:

🎮 Pygame Implementation (Main)

python pokemon_sprite_renderer.py sprites/1.gif
Controls
  • Drag and drop GIF files to view them
  • Press Escape to exit
  • Press 1-5 to quickly load sprites starting with those numbers

🔄 Simple GIF Viewer

A minimal implementation using Pygame:

python simple_gif_viewer.py sprites/25.gif
Controls
  • Press Escape to exit

🪟 Tkinter Implementation

A viewer using the built-in Tkinter library:

python tkinter_sprite_viewer.py sprites/4.gif
Controls
  • Use File > Open to load a sprite
  • Press 1-5 to quickly load sprites starting with those numbers
  • Press Escape to exit

📊 Matplotlib Implementation

A viewer using the Matplotlib library:

python matplotlib_sprite_viewer.py sprites/25.gif
Controls
  • Press 'o' to open a sprite file
  • Press 1-5 to quickly load sprites starting with those numbers
  • Press Escape to exit

💎 Qt Implementation (Optional)

A viewer using PySide6 (Qt). Requires additional installation:

pip install PySide6
python qt_sprite_viewer.py sprites/6.gif
Controls
  • Drag and drop GIF files to view them
  • Use File > Open to load a sprite
  • Press 1-5 to quickly load sprites starting with those numbers
  • Press Escape to exit

🛠️ Implementation Details

Main Components

Component Description Pokemon Type
download_sprites.py Downloads animated Pokémon sprites from the PokéAPI GitHub repository ⬇️ Normal
pokemon_sprite_renderer.py The main Pygame-based implementation for viewing animated sprites 🔥 Fire
simple_gif_viewer.py A simplified version of the Pygame renderer 💧 Water
tkinter_sprite_viewer.py An implementation using Tkinter, which is included in the Python standard library 🌿 Grass
matplotlib_sprite_viewer.py An implementation using Matplotlib for rendering ⚡ Electric
qt_sprite_viewer.py An implementation using PySide6 (Qt) for a modern UI experience ✨ Psychic

Dependencies

  • Pygame: For rendering graphics and handling input in the main implementation
  • Pillow (PIL): For processing GIF images
  • Requests: For downloading sprites from the internet
  • tqdm: For progress bars during downloads
  • Matplotlib & NumPy: For the Matplotlib implementation
  • PySide6 (Optional): For the Qt implementation

✨ Customization

Scaling Sprites

Most implementations include commented code for scaling sprites if they're too small. To enable scaling, uncomment the relevant sections in the viewer of your choice.

Adding Custom Sprites

You can add custom sprites to the sprites/ directory and view them with any of the renderers. The viewers support any properly formatted GIF file.

❓ Troubleshooting

Common Issues

  1. GIF animation appears choppy
    This can happen with GIFs that have inconsistent frame durations. Each implementation handles timing slightly differently.

  2. Error: No module named 'PySide6'
    The Qt implementation is optional. Either install PySide6 with pip install PySide6 or use one of the other viewers.

  3. Sprite files not found
    Make sure to download sprites first with download_sprites.py or place your GIF files in the sprites/ directory.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • PokéAPI for providing the Pokémon sprite data
  • Pokémon is © Nintendo, Game Freak, and The Pokémon Company
  • This project is for educational purposes only

"The important thing is not how long you live. It's what you accomplish with your life."

— Mewtwo

About

Rendering Pokemon sprites has never been fun before, that to in my favorite language Python!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages