解决方法
试试这个:
package demo; import javax.imageio.ImageIO; import java.io.File; import java.io.IOException; public class Main { public static void main( String [] args ) throws IOException { File input = new File("input.gif"); File output = new File("output.png"); ImageIO.write( ImageIO.read( input ),"png",ouput); } }
阅读ImageIO.
当然,您可能希望从流中读取和写入.