public static MatrixData DownScale(this MatrixData input, int factor, bool favorBrightPx = true)
        {
            MatrixData output = new MatrixData(input.Height() / factor, input.Width() / factor);

            for (int r = 0; r < output.NumberOfRows; r++)
            {
                for (int c = 0; c < output.NumberOfColumns; c++)
                {
                    MatrixData inpx = new MatrixData(input, r * factor, c * factor, factor, factor);
                    output[r, c] = (favorBrightPx)? (inpx.MeanPixel() + inpx.Percentile(25)) / 2: inpx.MeanPixel();
                }
            }
            return(output);
        }
        public static MatrixData Convert18To6Px(this MatrixData input, bool favorBrightPx = true)
        {
            MatrixData output = new MatrixData(6, 6);
            int        outR   = 0;
            int        outC   = 0;

            for (int r = 0; r < input.Height(); r += 3)
            {
                outC = 0;
                for (int c = 0; c < input.Width(); c += 3)
                {
                    MatrixData m = input.CopyData(r, c, 3, 3);
                    output[outR, outC] = (favorBrightPx)? (m.MeanPixel() + m.Percentile(25)) / 2 : m.MeanPixel();
                    outC++;
                }
                outR++;
            }
            return(output);
        }