См. Graphics.setClip ( Shape shape):
Graphics g = image.getGraphics();
g.setClip(shape);
Затем вы можете применить фильтр ко всей графике (изображению), но он будет толькоприменяется к области отсечения.
Приведенный ниже код создаст это изображение:
![Examples of clips](https://i.stack.imgur.com/Nkv5d.png)
public static void main(String[] args) throws Exception {
BufferedImage image = new BufferedImage(400, 400, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = (Graphics2D) image.getGraphics();
// set "user defined" clip
g.setClip(new Polygon(
new int[] { 50, 100, 50 },
new int[] { 50, 50, 100 },
3));
g.fillRect(0, 0, 400, 400);
// set an ellipse
g.setClip(new Ellipse2D.Double(100, 100, 200, 200));
g.fillRect(0, 0, 400, 400);
// set an rectangle
g.setClip(new Rectangle(300, 300, 50, 50));
g.fillRect(0, 0, 400, 400);
g.dispose();
ImageIO.write(image, "png", new File("test.png"));
}