code: private void process(int[] srcImage, int[] dstImage, int x, int y)
      {
          final int b = getSourcePixel(srcImage, x, y - 1);
          final int d = getSourcePixel(srcImage, x - 1, y);
          final int e = getSourcePixel(srcImage, x, y);
          final int f = getSourcePixel(srcImage, x + 1, y);
          final int h = getSourcePixel(srcImage, x, y + 1);
          int e0 = e;
          int e1 = e;
          int e2 = e;
          int e3 = e;
          if (b != h && d != f)
          {
              e0 = d == b ? d : e;
              e1 = b == f ? f : e;
              e2 = d == h ? d : e;
              e3 = h == f ? f : e;
          }
  
          setDestPixel(dstImage, x * SCALE, y * SCALE, e0);
          setDestPixel(dstImage, x * SCALE + 1, y * SCALE, e1);
          setDestPixel(dstImage, x * SCALE, y * SCALE + 1, e2);
          setDestPixel(dstImage, x * SCALE + 1, y * SCALE + 1, e3);
      }
docs: Process filter.
  
  @param srcImage The image source.
  @param dstImage The image destination.
  @param x The location x.
  @param y The location y.