added single component matrix and changed getgraymatrix

collaborated with SantiMunin(https://github.com/SantiMunin)