Image File Formats
Choose the right format for your use case
Table of contents
- Supported Formats
- Format Characteristics
- Automatic WebP Optimization
- Best Practices
- Browser Support
- Need help?
Supported Formats
The API supports three image formats:
- PNG (default)
- JPG
- WebP
To specify a format, add the appropriate file extension to your image URL:
Format | Example URL | Best For |
---|---|---|
PNG | https://hcti.io/v1/image/abc123.png | Screenshots, images with transparency |
JPG | https://hcti.io/v1/image/abc123.jpg | Photos, complex images with no transparency |
WebP | https://hcti.io/v1/image/abc123.webp | Modern web applications, optimal compression |
Default Format
If no extension is specified, the API will return a PNG image.
Format Characteristics
PNG
- Lossless compression
- Supports transparency
- Larger file size
- Best for:
- Screenshots
- Images with text
- Graphics with sharp edges
- Content requiring transparency
JPG
- Lossy compression
- No transparency support
- Smaller file size
- Best for:
- Photographs
- Complex images
- When transparency isn’t needed
- When smaller file size is priority
WebP
- Modern format
- Supports transparency
- Superior compression
- Best for:
- Web applications
- Progressive loading
- Optimal performance
- Modern browsers
Automatic WebP Optimization
All paid accounts receive automatic WebP optimization:
- Our edge servers detect the user’s browser capabilities
- If WebP is supported, images are automatically served in WebP format
- Fallback formats are served for non-supporting browsers
Benefits:
- Improved page load times
- Better SEO scores
- Reduced bandwidth usage
- No code changes required
Performance Tip
WebP typically provides 25-35% smaller file sizes compared to PNG/JPG while maintaining visual quality.
Best Practices
Format Selection
- Default to PNG for:
- Screenshots
- Text-heavy images
- When quality is critical
- Use JPG for:
- Photos
- Complex images
- When file size is priority
- Enable WebP for:
- Modern web applications
- Performance optimization
- Progressive enhancement
Browser Support
Format | Chrome | Firefox | Safari | Edge | IE11 |
---|---|---|---|---|---|
PNG | ✅ | ✅ | ✅ | ✅ | ✅ |
JPG | ✅ | ✅ | ✅ | ✅ | ✅ |
WebP | ✅ | ✅ | ✅ | ✅ | ❌ |
Need help?
Talk to a human. Please email us support@htmlcsstoimage.com with any questions and we’ll gladly help you get started.