import com.sun.image.codec.jpeg.*; //kuulub SUNi JDK-sse import java.awt.image.*; import java.awt.*; import java.io.*; public class JPEGKodeerija1{ public static void main(String argumendid[]) throws IOException{ BufferedImage pilt =new BufferedImage(50, 50, BufferedImage.TYPE_INT_RGB); Graphics piltg=pilt.createGraphics(); piltg.setColor(Color.green); piltg.drawOval(5, 5, 40, 40); JPEGCodec.createJPEGEncoder(new FileOutputStream("pilt1.jpeg")).encode(pilt); } }