Read about math behind different blend modes. Then I attempted to implement snapshotting strategy on Bitmap in swift-geometrize library which I port to Swift.