I am creating image having caption, but before applying text caption on images, the size of image is 1 mb but after that it increase so much approx 4-5 mb.
File f = new File("E:/picTest/08062016_110130_0.jpg");
final BufferedImage image = ImageIO.read(f);
String s ="hello";
Graphics g = image.getGraphics();
g.setFont(g.getFont().deriveFont(30f));
g.setColor(Color.black);
g.drawString(s, 100, 100);
g.dispose();
ImageIO.write(image, "png", new File("E:/picTest/test2.jpg"));
So, i want my image size not increase and if it increase, minimum size of image increse.