A Python utility to combine two GIF images side by side while maintaining the frame rate of the first GIF. This tool is perfect for creating comparison GIFs or combining multiple animated sequences.
- Combines two GIF images side by side
- Maintains the frame rate of the first GIF
- Supports different sized GIFs with automatic vertical centering
- Preserves transparency in GIF files
- Handles GIFs with different frame counts by looping shorter animations
- Output GIFs are set to loop forever
- Easy to use command line interface
- Comprehensive test suite included
- Python 3.8+
- Dependencies (automatically installed):
- Pillow (PIL) >= 10.0.0 - Image processing
- imageio >= 2.33.1 - GIF reading/writing
- numpy >= 1.26.4 - Array operations
- pytest >= 8.0.0 - Testing framework (development only)
- Clone the repository:
git clone https://github.com/yourusername/gifcombine.git
cd gifcombine- Create and activate a virtual environment:
# macOS/Linux
python -m venv venv
source venv/bin/activate
# Windows
python -m venv venv
.\venv\Scripts\activate- Install dependencies:
pip install -r requirements.txtpython gifcombine.py input1.gif input2.gif output.gifpython gifcombine.py animation1.gif animation2.gif combined.gif- The frame rate of the first GIF will be used for the combined output
- If GIFs have different heights, they will be centered vertically
- If GIFs have different frame counts, the shorter one will loop
- The output GIF will maintain transparency if present in the input files
- All output GIFs are configured to loop infinitely
pytest test_gifcombine.py -vgifcombine/
├── README.md
├── requirements.txt
├── gifcombine.py # Main script
├── test_gifcombine.py # Test suite
└── .gitignore
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Install development dependencies (
pip install -r requirements.txt) - Make your changes
- Run the tests (
pytest test_gifcombine.py -v) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- "ModuleNotFoundError": Make sure you've activated the virtual environment and installed dependencies
- "FileNotFoundError": Verify the input GIF files exist and paths are correct
- Memory Issues: When combining very large GIFs, ensure sufficient system memory is available
- If you see "Usage: python gifcombine.py input1.gif input2.gif output.gif", you need to provide all three required arguments
- If you get a PIL-related error, ensure your input files are valid GIF images
MIT License - See LICENSE for details
- Initial work - [Your Name]
- 1.0.1 (2025-02-20)
- Added infinite looping for output GIFs
- 1.0.0 (2025-02-20)
- Initial release
- Basic side-by-side GIF combining functionality
- Test suite implementation