Animated Format Comparison: GIF vs APNG
Size Comparison Table (2K Resolution, 1920x1080)
DurationStandard GIFOptimized GIFAPNGSize Reduction
5 sec~50 MB~12 MB~8 MB76-84%
10 sec~100 MB~20 MB~15 MB80-85%
15 sec~150 MB~25 MB~22 MB83-85%
20 sec~200 MB~30 MB~30 MB85%
30 sec~300 MB~40 MB~45 MB85-87%
Optimization Strategies Applied
GIF Optimizations
-
Dynamic Resolution Scaling
- 2K content: 75% scale (1440x810) for 10-20s
- 2K content: 50% scale (960x540) for 20-30s
- 4K content: Always 50% scale
-
Adaptive Frame Rate
- 0-3 seconds: 15 FPS (smooth motion)
- 3-10 seconds: 10 FPS (balanced)
- 10-20 seconds: 7 FPS (file size priority)
- 20-30 seconds: 5 FPS (maximum compression)
-
Color Optimization
- UI/Desktop: 128 colors with dithering
- Game content: 192-256 colors
- Temporal dithering to reduce banding
-
Frame Difference Encoding
- Only encode changed regions (30-70% size reduction)
- Transparent pixels for static areas
- Skip frames with <1% change
-
Dual Backend System
- Memory mode (<10s): Global optimization
- Streaming mode (>10s): Progressive encoding
APNG Optimizations
- No Resolution Loss - Maintains full quality
- Better Compression - PNG DEFLATE vs GIF LZW
- True Alpha Channel - Real transparency
- 24-bit Color - No palette limitations
- Frame Differencing - Native support
Recommended Use Cases
Use Optimized GIF When:
- Maximum compatibility is required (older browsers/apps)
- File size is not critical (<10 seconds capture)
- Simple graphics with limited colors (UI, text)
- Quick sharing on platforms that don't support APNG
Use APNG When:
- Quality matters (game footage, detailed content)
- Longer captures (>10 seconds)
- 2K/4K content without quality loss
- Smooth gradients or many colors needed
- Transparency is important
Implementation Recommendations
For Your SKSE Plugin v3.0:
- Auto-Format Selection Logic:
if (duration <= 5 && !is2K) { // Use GIF for short, low-res captures format = "GIF"; } else if (duration > 15 || is2K) { // Use APNG for long or high-res captures format = "APNG"; } else { // Let user choose or use quality preference format = prioritizeQuality ? "APNG" : "GIF"; }
- User Settings in MCM Menu:
- Format: Auto / GIF / APNG
- Quality Priority: Size / Balanced / Quality
- Max Duration: 5s / 10s / 15s / 30s
- Auto-Optimize: On/Off
- Show Size Estimate: On/Off
- Papyrus Interface:
; New functions for v3.0 Function CaptureAnimated(string format, int duration, bool optimize) Function GetRecommendedFormat(int width, int height, int duration) Function GetEstimatedSize(string format, int duration) Function SetOptimizationLevel(int level) ; 0=off, 1=balanced, 2=aggressive
Performance Considerations
Memory Usage:
- Standard GIF: Entire capture in RAM (~2.4GB for 30s@2K)
- Optimized GIF: Streaming mode uses <200MB RAM
- APNG: Streaming mode uses <100MB RAM
CPU Usage:
- GIF Quantization: High CPU for color reduction
- APNG Compression: Moderate CPU for DEFLATE
- Diff Calculation: Low CPU overhead
Capture Impact:
- Optimizations run in worker thread
- No impact on game performance
- Frame dropping if encoding falls behind
File Size Formulas
GIF Size Estimation:
size = (width * height * frames * colorBits / 8) * compressionRatio * diffRatio where: compressionRatio = 0.3-0.5 (LZW efficiency) diffRatio = 0.3-0.7 (based on motion) colorBits = log2(colors)
APNG Size Estimation:
size = (width * height * 4 * frames) * 0.15 * diffRatio where: 0.15 = typical PNG compression ratio diffRatio = 0.4-0.8 (based on motion)
Migration Path for Existing Users
- Preserve existing functionality - MultiGIF still works
- Add new AnimatedPNG option alongside GIF
- Auto-upgrade suggestions for 2K users
- Size warnings before capture starts
- Format comparison in UI
Testing Recommendations
Test these scenarios:
- Static UI: 30s capture of inventory screen
- High Motion: 10s combat sequence
- Mixed Content: 20s exploration with UI overlays
- 2K/4K: Various resolutions and durations
- Memory Limits: 30s captures on 8GB system