How to download and save image from URL
The 'javax.imageio.ImageIO' is a handy class which provides lots of utility methods related to images processing in Java. Using this class we can read and write images into disk. In below example, We will see how to use 'javax.imageio.ImageIO' to read an image from URL and save it into different formats. import java.awt.image.BufferedImage; import java.io.File; import java.net.URL; import javax.imageio.ImageIO; /** * This class will download the image from the specified URL and download it in * different format. * * @author abdulwaheed18 @gmail.com * */ public class ImageDownloader { /** * @param args */ public static void main(String[] args ) { String imageUrl = "http://img.gettyimageslatam.com/public/userfiles/redesign/images/landing/home/img_entry_002.jpg" ; try { System. out .println( "Downloading Image..." ); URL url = new URL( imageUrl ); ...