https://github.com/tirth063/spring-image-forge
A powerful Spring Boot REST API for dynamic image generation, perfect for placeholders, mockups, and testing environments.
https://github.com/tirth063/spring-image-forge
2d-graphics api backend developers image-api image-processing java open-source placeholder-image programming rest-api springboot web-development
Last synced: 10 months ago
JSON representation
A powerful Spring Boot REST API for dynamic image generation, perfect for placeholders, mockups, and testing environments.
- Host: GitHub
- URL: https://github.com/tirth063/spring-image-forge
- Owner: tirth063
- License: mit
- Created: 2024-12-23T07:20:58.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-12-23T08:05:23.000Z (12 months ago)
- Last Synced: 2025-01-17T05:11:56.356Z (11 months ago)
- Topics: 2d-graphics, api, backend, developers, image-api, image-processing, java, open-source, placeholder-image, programming, rest-api, springboot, web-development
- Language: Java
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 🖼️ SpringImageForge | Dynamic Image Generator API
[](LICENSE)
[](https://spring.io/projects/spring-boot)
[](https://www.oracle.com/java/)
[](https://swagger.io/)
[](CONTRIBUTING.md)
> 🚀 A powerful, lightweight Spring Boot REST API for dynamically generating placeholder images, perfect for mockups, prototypes, and testing environments.
## ✨ Features
- 🎨 Multiple image formats (PNG, SVG, JPEG, GIF, WebP)
- 📱 Retina display support (@2x, @3x)
- 🎯 Custom dimensions with smart defaults
- 🌈 Dynamic color customization (hex codes & color names)
- 📝 Custom text with multi-line support
- ⚡ High-performance image generation
- 🛡️ Built-in error handling and validation
- 📊 RESTful API design
## 🚀 Quick Start
### Prerequisites
- Java 21 or higher
- Maven 3.6+ or Gradle 7.0+
- Spring Boot 3.2.0+
### Installation
```bash
# Clone the repository
git clone https://github.com/yourusername/spring-image-forge.git
# Navigate to project directory
cd spring-image-forge
# Build the project
mvn clean install
# Run the application
mvn spring-boot:run
```
## 🎯 API Usage
### Base URL
```
http://localhost:8080/api/v2
```
### Generate Default Image
```http
GET /generate
```
### Generate Custom Image
```http
GET /generate/{width}x{height}[/{bgColor}][/{textColor}][.{format}]
```
### Examples
1. Basic Image (300x150):
```
/generate/300x150
```
2. Custom Colors:
```
/generate/600x400/FF0000/FFFFFF
```
3. Retina Display:
```
/generate/600x400@2x
```
4. Custom Text:
```
/generate/600x400?text=Hello+World
```
5. SVG Format:
```
/generate/600x400.svg
```
## 🎨 Supported Features
### Image Formats
- PNG (default)
- SVG (vector graphics)
- JPEG/JPG
- GIF
- WebP
### System Fonts
- serif
- sans-serif
- monospace
- dialog
- dialoginput
### Color Formats
- Hex codes (#FF0000)
- Color names (red, blue, etc.)
- Default fallback colors
## 🔧 Configuration
```yaml
# application.properties or application.yml
spring:
application:
name: spring-image-forge
server:
port: 8080
```
## 🛠️ Technical Details
### Architecture
- RESTful API design
- Spring Boot 3.x
- Java AWT for image processing
- SVG generation support
- Error handling middleware
- Input validation
- Logging implementation
### Performance
- Lightweight response payloads
- Optimized image generation
- Caching support
- Memory-efficient processing
## 📚 Use Cases
1. **Development & Testing**
- Placeholder images for prototypes
- UI/UX mockups
- Design system testing
2. **Content Management**
- Dynamic banner generation
- Thumbnail creation
- Social media assets
3. **E-commerce**
- Product image placeholders
- Category thumbnails
- Banner generation
## 📄 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Star History
[](https://star-history.com/#tirth063/spring-image-forge&Date)
---
## 🔗 Related Projects
- [Spring Boot Bill-Generation-System](https://github.com/tirth063/Bill-Generation-System)
- [Spring Boot Sale Campaign System](https://github.com/tirth063/Sale-Campaign-System)
- [Java-Servlet-and-MySQL Sign-in and Sign-up](https://github.com/tirth063/-User-Registration-and-Login-System-using-java-Servlet-and-MySQL)
---
Made with ❤️ by [Tirth R. Patel](https://github.com/tirth063)