public List<Tuple2<PixelType, Integer>> shrink(PixelType[] line){
            List<Tuple2<PixelType, Integer>> list = new ArrayList<Tuple2<PixelType, Integer>>();
            PixelType past = null;
            PixelType cur = null;
            int count = 0;

            for (int i=0; i<line.length; i++) {
                cur = line[i];
                if(past != null && past == cur){
                    count++;
                }else if(past == null || past != cur){
                    if(count > 0){
                        list.add(Tuple._(past, count));
                    }
                    past = cur;
                    count = 1;
                }
            }
            if(cur != null){
                list.add(Tuple._(cur, count));
            }
            return list;
        }