Add matte implementation with sample and test.