consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);
Rectangle filterBounds = new Rectangle(this.x, this.y, this.width, this.height); Rectangle pixelBounds = new Rectangle(x, y, w, h);  if (filterBounds.intersects(pixelBounds)) { Rectangle bounds = filterBounds.intersection(pixelBounds);  byte[] cropped = new byte[bounds.width * bounds.height]; for (int i = 0; i < bounds.height; i++) { int start = (bounds.y - pixelBounds.y + i) * scansize + offset;  for (int j = 0; j < bounds.width; j++) cropped[i * bounds.width + j] = pixels[start + bounds.x + j]; }  consumer.setPixels(bounds.x, bounds.y, bounds.width, bounds.height, model, cropped, 0, bounds.width); }
    public void setPixels(int x, int y, int w, int h, 	   ColorModel model, byte[] pixels, int offset, int scansize)    {	consumer.setPixels(x, y, w, h, model, pixels, offset, scansize);    }