Added generate gray texture function