func BenchmarkTool_BlendSourceToTarget(b *testing.B) {
	tool := blend.New(blenderStub{})
	for name, resolution := range resolutions {
		b.Run(name, func(b *testing.B) {
			source := newImageSelection(resolution.width, resolution.height)
			target := newImageSelection(resolution.width, resolution.height)
			b.ReportAllocs()
			b.ResetTimer()
			for i := 0; i < b.N; i++ {
				tool.BlendSourceToTarget(source, target)
			}
		})
	}
}
1920x1080 - 34ms
32x32     - 17us
package blend_test
import (
	"testing"
	"github.com/jacekolszak/pixiq/blend"
	"github.com/jacekolszak/pixiq/image"
	"github.com/jacekolszak/pixiq/image/fake"
)
var resolutions = map[string]struct {
	width, height int
}{
	"1920x1080": {
		width:  1920,
		height: 1080,
	},
	"32x32": {
		width:  32,
		height: 32,
	},
}
func BenchmarkSource_BlendSourceToTarget(b *testing.B) {
	tool := blend.NewSource()
	for name, resolution := range resolutions {
		b.Run(name, func(b *testing.B) {
			source := newImageSelection(resolution.width, resolution.height)
			target := newImageSelection(resolution.width, resolution.height)
			b.ReportAllocs()
			b.ResetTimer()
			for i := 0; i < b.N; i++ {
				tool.BlendSourceToTarget(source, target)
			}
		})
	}
}
func BenchmarkSourceOver_BlendSourceToTarget(b *testing.B) {
	tool := blend.NewSourceOver()
	for name, resolution := range resolutions {
		b.Run(name, func(b *testing.B) {
			source := newImageSelection(resolution.width, resolution.height)
			target := newImageSelection(resolution.width, resolution.height)
			b.ReportAllocs()
			b.ResetTimer()
			for i := 0; i < b.N; i++ {
				tool.BlendSourceToTarget(source, target)
			}
		})
	}
}