Web Publishing of Photographs

Introduction

Many digital cameras and smart phones produce JPEG image files over 1MB by default but for someone working over the Internet, downloading a directory of such images may take too long or cost too much. For many web applications, smaller and lower quality photographs are at least acceptable.

Most existing image editing programs like The Gimpoffer interactive dialogues that enable you to choose the most appropriate compromise between file size and image quality. However, editing all your photographs by hand just to produce a copied set with smaller file sizes is a waste of effort when other programs can automate this task for you. Apple Mac owners can use the batch features of iPhotowhich is free with Mac OS X, but for everyone else, you might like to try this Java application called JPEGDirCopy from Jeremy Parsons. The latest version of JPEGDirCopy (version 2.1) uses a new image compression library org.imgscalr written carefully for optimal results and runs in parallel using all the the CPU cores in your computer for extra speed.

Gif Image of the JPEGDirCopy Graphical User Interface

Running the Application

The JPEGDirCopy Java application has both a command-line and a GUI interface. The GUI is shown above and is very clunky by the standards of normal distributed software, but it works - just.  Download the JPEGDirCopy.jar from the software download directory, ensure you have a working version of Java2, and then choose either the command line or the GUI interfaces.

Graphical User Interface

Start the GUI application by just double clicking on the jar file (if your operating supports Java jars that way) or with the following command line or.

java -jar JPEGDirCopy.jar

Once the program is running, you need to tell it what you want it to do:

Once all the values have been set, and you have pressed each of the left hand buttons (important), then press the "Start Copying" button and watch it go. I use the JPEG copier to produce amazingly compressed pictures for email and web publishing though certain scenes compress much better than others.

Command-line Operation

java -jar JPEGDirCopy.jar original_directory_name copied_directory_name width_in_pixels height_in_pixels quality(0.1 - 0.9, 0.75 default) maximise_compatibility(true|false)
java -cp JPEGDirCopy.jar com.jeremyparsons.imaging.JPEGDirCopy  original_directory_name copied_directory_name width_in_pixels height_in_pixels quality(0.1 - 0.9, 0.75 default) maximise_compatibility(true|false)

Image Directory Compression

A good compromise between file size, quality, and the expected available screen space of a typical Web surfer would be to use an image size of 800 by 700 pixels and a JPEG quality level of 0.70 to give a typical file size of 70 KB though highly detailed photographs of forests, complex textures etc. would be around 100KB and sunsets or big blue skies around 30KB.

Be warned that when the program runs, it makes a smaller copy of every JPEG file that it finds in all the subdirectories of the first folder that you specify so avoid specifying the top of big directory trees and also avoid copying recursively (where the output folder is a subdirectory of the input folder). The program should never delete a single file so it should not really be dangerous.

Note about Java

The program is written in Java which allows people to download programs to run safely in their Web browsers, often games or scientific viewers on any kind of computer. However, because this program runs outside a browser and needs to be able to read and write files on local disks, this Java program is not a Java applet but a full Java application and it needs a Java Runtime Environment (JRE) in which to run. This is no problem because Sun Microsystems gives away the JRE for all kinds of computers and you can download the very latest version (Java 2 JRE 1.4) from http://java.sun.com/  


Littlest Home Page Jeremy Parsons' Home Page