Java batch conversion of image formats, java batch conversion

Source: Internet
Author: User

Java batch conversion of image formats, java batch conversion

There is not much nonsense, and there is not much code ....

Package com. qiao. testImage; import java. awt. image. bufferedImage; import java. io. file; import java. io. IOException; import java. util. arrayList; import java. util. list; import javax. imageio. imageIO; public class imageChange {public static void main (String [] args) throws IOException {List <String> item = new ArrayList <String> (); file file = new File ("D: \ test \ temp"); File [] files = file. listFiles (); // System. out. println ("files length" + files. length); for (int I = 0; I <files. length; I ++) {File file1 = files [I]; file1.getName (); // System. out. println ("output file suffix" + file1.getName (); if (file1.getName (). indexOf (". jpg ")>-1) {item. add ("D :\\ test \ temp \" + files [I]. getName (); System. out. println ("output file files [I]. getName (): "+ files [I]. getName () ;}}for (int I = 0; I <item. size (); I ++) {System. out. println ("item set Internal data" + item. get (I); String type = "png"; File src = new File (item. get (I); File dir = new File ("D: \ test \ image"); trans (src, dir, type );}} public static void trans (File imgFile, File outDir, String type) throws IOException {BufferedImage img = ImageIO. read (imgFile); // set the file name to String srcName = imgFile. getName (). replace (". jpg "," ") + ". "+ type; File out = new File (outDir + File. separator + srcName); ImageIO. write (img, type, out );}}Java batch conversion of image formats

 


Batch conversion of image formats

FotoBatch (formerly known as magic conversion) is a powerful software for batch conversion and processing of images. With this tool, you can develop an image processing script and then convert images in batches Based on the script. FotoBatch provides over 30 script commands for image processing, such as adjusting the image size, adjusting the saturation, and adding translucent watermarks. It can also create an automatically played EXE file and share it with your family and friends. It also supports conversion of WINDOWS right-click menus and allows you to customize WINDOWS right-click menus. It supports all popular image formats, including bmp, jpg, gif, png, tif, pcx, wmf, emf, tga, ico, and wbmp, it also contains txt, rtf, htm, and other character painting formats.
Latest FotoBatch 5.0.3 (2006/02/20)
* Added the "Image Layout" and "Adjust color temperature" script commands.
* Two image size adjustment filters are added.
* Fixed the issue that certain TIF files cannot be read.
* Fixed the error message in the script drop-down list.
* Minor bugs are fixed.

References are software
Reference: www.skycn.com/soft/3265.html
Reference: zhidao.baidu.com/question/31723440.html? Si = 2

How to convert image formats in batches?

The method is as follows:
Press the win + r combination button to open the run box, Enter cmd in it, press the Enter key, open the Command Prompt window, and switch to the disk of the image to be modified in batches. For example:
C: \ Documents ents and Settings \ Administrator> cd/d e:
Press the Enter key to open the drive letter drive C to drive E, and then enter the folder where your image is located, for example, the folder where your image is located is named "image ",
E: \> cd Image
After entering, enter the following command: ren *. jpg *. bmp, which means to change the image in jpg format to bmp format.
If you are not busy with the above method, you can use the following method:
Open the notebook and enter ren * in it *. jpg *. bmp, save, save all files of the type, file name is 1.bat, then 1. cut the bat file to the file directory you want to change in batches, and double-click the file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.