@Override public int compareTo(Metrics o) {
    byte[][] pixels;
    if ( o instanceof AbstractMetrics ) {
      pixels = ((AbstractMetrics)o).pixels;
    } else {
      Metrics m = (Metrics)o;
      pixels = new byte[m.getWidth()][m.getHeight()];
      m.fillArray(pixels);
    }
    if ( this.pixels.length < pixels.length ) {
      return +1;
    }
    for ( int i = 0; i < this.pixels.length; ++i ) {
      if ( i >= pixels.length ) {
        return -1;
      }
      if ( this.pixels[i].length < pixels[i].length ) {
        return +1;
      }
      for ( int j = 0; j < this.pixels[i].length; ++j ) {
        if ( i >= pixels[i].length ) {
          return -1;
        }
        int c = this.pixels[i][j] - pixels[i][j];
        if ( c != 0 ) {
          return c;
        }
      }
    }
    return 0;
  }