import java.awt.image.*; import java.awt.geom.*; import java.awt.*; import java.applet.*; public class Pildiuhtlustus2 extends Applet{ BufferedImage pilt1=new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); BufferedImage pilt2=new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB); public Pildiuhtlustus2(){ Graphics g=pilt1.createGraphics(); g.setColor(Color.green); g.fillOval(10, 10, 80, 80); g.setColor(Color.blue); g.fillOval(10, 10, 20, 20); g.setColor(Color.red); g.fillOval(70, 70, 20, 20); float andmed[]=new float[100]; for(int i=0; i<100;i++)andmed[i]=0.01f; ConvolveOp co=new ConvolveOp(new Kernel(10, 10, andmed)); co.filter(pilt1, pilt2); } public void paint(Graphics g){ g.drawImage(pilt1, 25, 50, this); g.drawImage(pilt2, 175, 50, this); } public static void main(String argumendid[]){ Frame f=new Frame("Pildi värvide tasandamine"); f.add(new Pildiuhtlustus2()); f.setSize(300, 200); f.setVisible(true); } }