Image Contours is a pure C# implementation of the Suzuki-Abe border following algorithm for Unity. It analyzes images and extracts outer contours and inner holes.
This package helps when you need to programmatically understand image shapes—whether you're highlighting shape outlines, creating editing tools, or building systems that need to work with image boundaries.
What makes it special:
- 100% C# implementation - No native plugins, works on any Unity platform (Windows, Mac, Linux, iOS, Android, WebGL, consoles)
- Hierarchical contour detection - Automatically identifies holes and parent-child relationships
- Flexible pixel classification - Use built-in alpha threshold detection or provide your own predicate to define what counts as foreground
- Connectivity options - Choose between 4-connected or 8-connected pixel neighborhoods
- Production-ready - Extensively tested with comprehensive unit test coverage
- Easy integration - Clean API that's easy to understand and extend for your specific needs
Typical Use Cases:
- Detect texture outlines for highlighting or selection systems
- Build tools that need to know where pixels are in a sprite
- Extract boundaries for pathfinding or AI systems
What's Included:
- Core contour detection implementation
- Two visualization examples: LineRenderer-based and pixel-based drawing
- One sample scene demonstrating different parameter configurations
- Full source code with detailed comments and XML documentation
- Unit test suite for validation
The package includes example components that show how to visualize detected contours. All code is documented and designed to be easy to understand and extend for your specific needs.