Optimized ByteImage.cs