Design, CG Graphics & Inspiration
How to Optimize PNG and JPEG without Quality Loss. Part 2

How to Optimize PNG and JPEG without Quality Loss. Part 2

That’s the right time for the second, and, hopefully, a long-awaited part of my first article – How to Optimize PNG and JPEG without Quality Loss. I recommend everyone to read the first part, because without reading it it will be difficult to understand what I’m writing about. In this part, I’ll move from the theory to the practice, and will show a small project for a comprehensive image enhancement.

Image Catalyst is a collection of programs for complex optimization / compression of PNG and JPEG image formats without loss of quality within the same format. You can apply it to speed up the loading of graphic elements (eg, sprites) of the web pages.

I would like to warn our readers, that I am not responsible for the operations of this application. You use this application at your own risk. It is strongly recommended to make a backup image before the optimization in order to avoid undesirable consequences, and you’d better study this article carefully before working with it.

Here you can download Image Catalyst 2.0 (for windows only). Unfortunately the site is still under development, so all questions can be asked here.

PNG optimization programs

For the complex optimization of PNG images you can use the following applications:

AdvDef (part of the AdvanceComp 1.15 of 01.11.2005);
CryoPNG (23.10.2010);
DeflOpt 2.07 (05.09.2007);
Defluff 0.3.2 (07.04.2011);
TruePNG 0.3.2.5 (07.06.2011);
PNGOut (02.07.2011);
PNGWolf (01.04.2011);
Zlib 1.2.5 (19.04.2010).

In the first part I’ve wrote about these applications in details.

JPEG optimization programs

For the complex optimization of JPEG images you can use the following applications:

• Jhead 2.90 (05.02.2010);
• JPEGTran (a part of Libjpeg 8c of 16.01.2011).

In the first part I’ve wrote about these applications in details.

Additional software

iniTool 1.20 application of 02/07/2010 is also used today.

PNG optimization

PNG-screen in How to Optimize PNG and JPEG without Quality Loss. Part 2

PNG optimization parameters

Both methods of displaying images in the browser when loading are supported:

• Non-interlaced – the browser loads them sequentially, from the top to the bottom, as new information from the network appears.
• Interlaced –the file in the browser displays the image in low resolution till the complete file download, i.e. first you will see the image of poor quality, and then, as far as the graphical information is being received, the image quality will be improving gradually. Interlaced display helps to reduce the subjective download time and to show users that the image is being loaded, but interlaced display also increases file size.

PNG optimization algorithms

On the basis of PNG optimization parameters the following optimization algorithms were created:

• Non-interlaced – uses the Non-interlaced optimization parameters;
• Interlaced – uses the Interlaced optimization parameters;
• Default – optimizes the picture, but it does not change the optimization parameter.

PNG optimization modes

In the last part, I’ve wrote that the more time is spent on the optimization of PNG, the higher the degree of optimization, that’s why several modes of optimization were developed:

• Fast – the compression ratio and optimization speed is quite high;
• Normal – the optimization speed on the average is 3 times lower and the compression ratio is higher on 1.5% compared to the Fast mode;
• Xtreme – the optimization speed on average is 4 times lower and the compression ratio is higher on 1% compared to the Normal mode.

In some cases, the compression ratio can be higher on 10% or more.

JPEG optimization

JPEG-screen.png in How to Optimize PNG and JPEG without Quality Loss. Part 2

JPEG optimization parameters

Two methods of displaying images in the browser when loading are supported:

• Optimized – creates an improved JPEG file with a smaller file size. Browsers load them sequentially, from the top to the bottom, as new information from the network appears.
• Progressive – till the complete file download the image is displayed as a series of overlays that can display an image with lower resolution i.e. first you will see the image of poor quality, and then, as far as the graphical information is being received, the image quality will be improving gradually. Internet Explorer, including an eighth version does not support progressive JPEG download , it shows it only after fully downloading the file, which is very different from that of “traditional» JPEG, when an image is displayed from top to bottom, as it is loading.

JPEG optimization algorithms

On the basis of JPG optimization parameters the following optimization algorithms were created:

• Optimize – uses Optimize parameter for optimization;
• Progressive – uses Progressive optimization parameter;
• Maximum -images’ sizes obtained with Optimize and Progressive optimization methods are compared, and a file with the smallest size is selected, it makes sense to use it if the image size is smaller than 10 kilobytes, otherwise the optimization method is almost always exceeds the Progressive method Optimize;
• Default – optimizes the image, but it doesn’t change the optimization parameter.

Optimization tools

• By default ,the number of simultaneous processing PNG images threads equals the number of cores in the processor, so if you want to change the number of simultaneous streams, then open the file Tools \ config.ini in any text editor and follow the instructions. It’s not recommended to install the greater number of simultaneous streams than the number of cores in the processor;
• By default, PNG and JPEG images are optimized in subfolders of the specified folder, and if you want to disable this feature, open the file Tools \ config.ini in any text editor and follow the instructions.
• By default, a file Images.cvs is created, and if you don’t want to create the file, then open the file Tools \ config.ini in any text editor and follow the instructions.
• By default, when optimizing JPEG-files all Metadata is being removed, unless you want to delete some Metadata, then open the file Tools \ config.ini in any text editor and follow the instructions.
• By default, when optimizing PNG-files all Chunks are being removed, unless you want to delete certain Chunks, then open the file Tools \ config.ini in any text editor and follow the instructions.
• By default, when optimizing PNG-files ColorType BitDepth parameters’ optimization is used, and if you don’t want to change these settings, open the file Tools \ config.ini in any text editor and follow the instructions.
• By default, when optimizing PNG-files with alpha channel «Dirty Transparency» function is applied, and if you don’t want to use this system, then open the file Tools \ config.ini in any text editor and follow the instructions.
• It is not recommended to run more than one copy of Image Catalyst for one images optimization session.
• There shouldn’t be any & ^%! symbols in the title and / or address of the image.

A few words about competitors

Here, I’ll tell a few words about competitors, but rather one of them, as I consider it a worthy competitor. ScriptPNG and ScriptJPG are pretty interesting projects, in contrast to the Image Catalyst PNG and JPEG image formats optimization is divided into two separate projects and don’t have any parallel PNG optimization of support. So I recommend you to visit the site of this project, as recently there appeared articles on PNG optimization.

And a bit more…

There is a pretty interesting project – JPGCrush – designed specifically to optimize JPEG without quality loss, being in turn built on the basis of JPEGTran. It creates a JPEG format only in Progressive. The only drawback – works only in * nix-systems.

To read original article in Russian click here.

You might also be interested in..

How to Optimize PNG and JPEG without Quality Loss. Part 1
About PNG Optimization Techniques

  • Lorents,
  • August 29, 2011

SHARE THIS POST

Subscribe for the hottest posts

Subscribe to our email newsletter for useful tips and freebies.