Advancegg
AdvanceGG is a modern, high-performance 2D graphics library for Go — a direct fork and evolution of gg.
Install / Use
/learn @GrandpaEJ/AdvanceggREADME
AdvanceGG - a high performance image manipulation and 2D Graphics Library for Go 🎨
Package gg provides a simple API for rendering 2D graphics in pure Go . advancegg more powerfull to do that same work , advancegg high performance image manipulation lib and rendering 2D graphics write in pure go.
The most advanced, feature-rich 2D graphics library for Go developers. Create stunning visualizations, professional charts, game graphics, and interactive applications with unparalleled ease and performance.<br>
Graphics Demo <img src="docs/images/gif/easing-demo.gif" alt="Image Filters" width="100%"><br>
AdvanceGG transforms Go into a powerhouse for 2D graphics programming. Whether you're building data visualizations, creating game assets, designing user interfaces, or developing creative applications, AdvanceGG provides everything you need in one comprehensive, high-performance package.
🚀 Originally inspired by GG, completely reimagined and enhanced with 50+ professional features.
✨ Comprehensive Feature Set
<details> <summary><strong>🎨 Advanced Graphics Engine</strong> - Click to expand</summary>- 🏗️ Multi-Layer System - Photoshop-style layers with 13 blend modes (Normal, Multiply, Screen, Overlay, Soft Light, Hard Light, Color Dodge, Color Burn, Darken, Lighten, Difference, Exclusion)
- 🖌️ Advanced Stroke Styles - Dashed patterns, gradient strokes, tapered calligraphy effects, and custom line caps
- 📐 Vector Graphics - Path2D support with Bézier curves, arcs, and complex shapes
- 🎯 Pixel-Perfect Rendering - Sub-pixel anti-aliasing for crisp, professional output
- 🌈 Gradient Engine - Linear, radial, and conic gradients with unlimited color stops
- 🎭 Pattern Support - Texture fills and repeating patterns with independent transformations
- 🎪 DOM-Style Object Model - Tree structure for shapes with IDs, CSS-like classes, and style inheritance
- 🎯 Hit Testing System - Point-in-path detection for interactive graphics and UI elements
- 🎬 Animation Framework - Frame-based animations with 9 easing functions and GIF export
- 🌍 Unicode Shaping - Full support for Arabic, Hindi, Chinese, and complex scripts
- 😀 Emoji Rendering - Color emoji fonts with automatic fallback mechanisms
- 🌊 Text-on-Path - Text following circles, waves, spirals, and custom Bézier curves
- 📚 Font Management - TTF/OTF loading with advanced metrics and kerning
- 📏 Text Layout - Word wrapping, alignment, line spacing, and paragraph formatting
- ✨ Text Effects - Shadows, outlines, gradients, and 3D effects
- 🎛️ 20+ Filters - Blur, sharpen, edge detection, emboss, sepia, vintage effects
- 🎨 Color Management - ICC color profiles for print-accurate color reproduction
- 📁 Universal Format Support - PNG, JPEG, GIF, WebP, TIFF, BMP with quality control
- 🔄 Non-destructive Editing - Reversible filter chains and adjustment layers
- 🎚️ Color Spaces - RGB, CMYK, HSV, HSL, LAB for professional color workflows
- 🔍 Pixel Manipulation - Direct pixel access for custom algorithms and effects
- 🚀 SIMD Acceleration - CPU vector instructions for 4x faster image processing
- 🧠 Smart Memory Management - Memory pooling reduces garbage collection pressure
- 📦 Batch Operations - Optimized rendering pipeline for complex scenes
- 💾 Intelligent Caching - Automatic caching of fonts, images, and rendered elements
- 🔍 Spatial Indexing - O(log n) hit testing performance for interactive applications
- ⚡ Parallel Processing - Multi-core rendering for complex graphics operations
- 📊 Performance Monitoring - Built-in FPS tracking and performance profiling
- 🎯 SVG Import/Export - Load and save vector graphics in industry-standard format
🚀 Lightning-Fast Installation
Get started with AdvanceGG in seconds:
# Install the latest version
go get github.com/GrandpaEJ/advancegg
# Or get a specific version
go get github.com/GrandpaEJ/advancegg@v1.0.0
System Requirements:
- ✅ Go 1.18+ (supports generics and latest performance improvements)
- ✅ Any OS - Windows, macOS, Linux, FreeBSD
- ✅ Any Architecture - AMD64, ARM64, 386, ARM
- ✅ WebAssembly - Run in browsers with WASM support
- ✅ Zero Dependencies - No external libraries or system packages required
🌟 Why Choose AdvanceGG?
🏆 Industry-Leading Features
- 🎯 Zero Dependencies - Pure Go implementation, no external libraries required
- ⚡ Blazing Fast - SIMD optimizations and memory pooling for maximum performance
- 🎨 Professional Quality - Production-ready graphics rivaling commercial solutions
- 📱 Cross-Platform - Works seamlessly on Windows, macOS, Linux, and WebAssembly
- 🔧 Developer-Friendly - Intuitive API with excellent error messages and debugging tools
🚀 Perfect For
- 📊 Data Visualization - Interactive charts, dashboards, and business intelligence
- 🎮 Game Development - Sprites, UI elements, particle effects, and animations
- 🖼️ Image Processing - Professional photo editing and manipulation tools
- 📈 Scientific Computing - Mathematical visualizations and research graphics
- 🎨 Creative Applications - Digital art tools, design software, and creative coding
- 📱 Web Applications - Server-side image generation and dynamic graphics
📖 Documentation & Learning
📚 Interactive Documentation - Beautiful, responsive docs with live examples
| Resource | Description | Link | |----------|-------------|------| | 🚀 Quick Start | Get up and running in 5 minutes | Getting Started | | 📋 API Reference | Complete function documentation | API Docs | | 🎨 Examples Gallery | 50+ practical examples with source code | Examples | | 💡 Live Demos | Interactive examples you can run | Demo Site | | 🎯 Tutorials | Step-by-step learning guides | Tutorials |
🎯 Quick Start - Create Your First Masterpiece
🎨 Hello, Beautiful Graphics!
package main
import "github.com/GrandpaEJ/advancegg"
func main() {
// Create a high-resolution canvas
dc := advancegg.NewContext(1200, 800)
// Create a stunning gradient background
gradient := advancegg.NewLinearGradient(0, 0, 0, 800)
gradient.AddColorStop(0, advancegg.ColorFromHex("#667eea"))
gradient.AddColorStop(1, advancegg.ColorFromHex("#764ba2"))
dc.SetFillStyle(gradient)
dc.DrawRectangle(0, 0, 1200, 800)
dc.Fill()
// Draw a glowing circle with shadow
dc.SetRGBA(1, 1, 1, 0.1)
dc.DrawCircle(600, 400, 120) // Shadow
dc.Fill()
dc.SetRGB(1, 0.3, 0.5) // Vibrant pink
dc.DrawCircle(600, 400, 100)
dc.Fill()
// Add beautiful typography
dc.LoadFontFace("fonts/arial.ttf", 48)
dc.SetRGB(1, 1, 1)
dc.DrawStringAnchored("Hello AdvanceGG!", 600, 500, 0.5, 0.5)
// Save as high-quality PNG
dc.SavePNG("masterpiece.png")
// Also save as JPEG for web
dc.SaveJPEG("masterpiece.jpg", 95)
}
🎉 Result: A stunning gradient background with a glowing circle and beautiful typography!
📊 Professional Data Visualization
package main
import (
"fmt"
"github.com/GrandpaEJ/advancegg"
)
func main() {
// Create a professional dashboard
dc := advancegg.NewContext(1000, 700)
// Premium gradient background
bg := advancegg.NewLinearGradient(0, 0, 0, 700)
bg.AddColorStop(0, advancegg.ColorFromHex("#f8fafc"))
bg.AddColorStop(1, advancegg.ColorFromHex("#e2e8f0"))
dc.SetFillStyle(bg)
dc.DrawRectangle(0, 0, 1000, 700)
dc.Fill()
// Sales data for visualization
salesData := []struct {
month string
value float64
color string
}{
{"Jan", 85, "#3b82f6"}, {"Feb", 92, "#10b981"},
{"Mar", 78, "#f59e0b"}, {"Apr", 96, "#ef4444"},
{"May", 88, "#8b5cf6"}, {"Jun", 94, "#06b6d4"},
}
// Draw professional bar chart with shadows
for i, data := range salesData {
x := 150 + float64(i)*120
height := data.value * 5
// Drop shadow
dc.SetRGBA(0, 0, 0, 0.1)
dc.DrawRoundedRectangle(x+3, 550-height+3, 80, height, 8)
dc.Fill()
// Main bar with gradient
barGradient := advancegg.NewLinearGradient(x, 550-height, x, 550)
barGradient.AddColorStop(0, advancegg.ColorFromHex(data.color))
barGradient.AddColorStop(1, advancegg.ColorFromHex(data.color+"80"))
dc.SetFillStyle(barGradient)
dc.DrawRoundedRectangle(x, 550-height, 80, height, 8)
dc.Fill()
// Value labels with custom font
dc.LoadFontFace("fonts/roboto-bold.ttf", 16)
dc.SetRGB(0.2, 0.2, 0.2)
dc.DrawStringAnchored(fmt.Sprintf("%.0f%%"
