Hello Habr!
So it is time for the second, and hopefully long-awaited part. The abbot recommend to get acquainted with the
first part , because without this it will be hard to understand what I will write about. In this part, I will move away from theory to practice, namely, I will show a small project for the integrated optimization of images.
Image Catalyst is a collection of programs for integrated optimization / compression of PNG and JPEG images without loss of quality within the same format. It makes sense to use to speed up the loading of graphics elements (in particular, sprites) web pages.
')
I want to immediately warn, I am not responsible for the operation of this application. You use this application at your own risk. It is strongly recommended that before optimizing, make a backup copy of the images in order to avoid undesirable consequences and carefully study this article.Download Image Catalyst 2.0
from here (only for windows).
PNG Optimization Tools
For complex optimization of PNG images, the following applications are used:
In detail about these applications I told in the first part.
JPEG Optimization Tools
For complex optimization of JPEG images, the following applications are used:
In detail about these applications, I also told in the first part.
Additional software
Today, the application is also used -
iniTool 1.20 from
07/07/2010 .
PNG optimization

PNG optimization options
Both methods of displaying images in the browser when loading are supported:
- Non-interlaced - browsers download them sequentially, top to bottom, as information arrives from the network.
- Interlaced - until the file is fully downloaded, the image in the browser is displayed in low resolution. Interlaced display allows you to reduce the subjective loading time and show users that the image is loaded, but interlaced display also increases the file size.
PNG optimization algorithms
Based on the PNG optimization parameters, the following optimization algorithms were created:
- Non-interlaced - uses non-interlaced optimization parameters;
- Interlaced - uses Interlaced optimization parameters;
- Default - optimizes the image, but does not change the optimization parameter.
PNG optimization modes:
In the last part, we said that the more time spent on PNG optimization, the higher the degree of optimization, which is why several optimization modes were developed:
- Fast - compression ratio and optimization speed is quite high;
- Normal - compared to the Fast mode, the optimization speed is 3 times lower on average, the compression ratio is 1.5% higher on average;
- Xtreme - compared to the Normal mode, the optimization speed is 4 times lower on average, the compression ratio is 1% higher on average.
In some cases, the compression ratio may be higher by 10% or more.
Jpeg optimization

JPEG optimization options
Two methods of displaying images in the browser when loading are supported:
- Optimize - an enhanced JPEG file is created with a slightly smaller file size. Browsers download them sequentially, top to bottom, as information arrives from the network.
- Progressive - the image is displayed as a sequence of overlays, which allows you to display a low-resolution image before it is fully loaded, i.e. first you will see a low-quality image, then, as graphic information becomes available, the image quality will gradually improve. Internet Explorer, including the eighth version, does not support progressive JPEG download, it shows it only after a full download of the file, which is very different from the behavior of the "traditional" JPEG when the image is displayed from top to bottom as it downloads.
JPEG optimization algorithms
Based on the JPEG optimization parameters, the following optimization algorithms were created:
- Optimize - uses the Optimize optimization parameter;
- Progressive - uses the Progressive optimization parameter;
- Maximum - compares the image size obtained by Optimize and Progressive optimization methods, and selects the file with the smallest size, it makes sense to use if the image size is less than 10 KB, in other cases the optimization method Progressive almost always exceeds the Optimize method;
- Default - optimizes the image, but does not change the optimization parameter.
Optimization tools
- By default, the number of simultaneous PNG image processing threads is equal to the number of cores in the processor, if you want to change the number of simultaneous threads, open the Tools \ config.ini file with any test editor, and follow the instructions. It is not recommended to set the number of simultaneous threads more than the number of cores in the processor;
- By default, PNG and JPEG images in the subfolders of the specified folder are optimized. If you want to disable this feature, open the Tools \ config.ini file with any test editor, and follow the instructions.
- By default, the Images.cvs file is created, if you do not want to create this file, then open the Tools \ config.ini file with any test editor, and follow the instructions.
- By default, when optimizing JPEG files, all Metadata is deleted, if you do not want to delete certain Metadata, then open the Tools \ config.ini file with any test editor, and follow the instructions.
- By default, when optimizing PNG files, all Chunks are deleted, if you do not want to delete certain Chunks, then open the Tools \ config.ini file with any test editor, and follow the instructions.
- By default, when optimizing PNG files, the optimization of the ColorType and BitDepth parameters is used, if you do not want to change these parameters, then open the Tools \ config.ini file with any test editor, and follow the instructions.
- By default, when optimizing PNG files with an alpha channel, the “Dirty Transparency” function is used, if you do not want to use this system, then open the Tools \ config.ini file with any test editor, and follow the instructions.
- It is not recommended to run more than one copy of Image Catalyst in one image optimization session.
- In the title and / or in the address of the images there should not be characters such as & ^%!
Thank you for your help
I wanted to thank
x128 and
res2001 separately (if the article dials +100, then I will send an invite), without these people my project could hardly be implemented. I also wanted to thank all the author of the applications that are used in Image Catalyst.
A few words about competitors
Here I will tell a few words about competitors, or rather about one of them, because I consider him a worthy competitor.
ScriptPNG and
ScriptJPG are quite interesting projects, unlike Image Catalyst, the optimization of PNG and JPEG images is divided into two separate projects and there is no support for parallel PNG optimization. I also recommend visiting the project
site itself, since recently there appeared articles about optimization of PNG.
And a bit more...
There is one rather interesting project -
JPGCrush - created specifically for optimizing JPEG without losing quality, being in turn an add-on over JPEGTran. Creates JPEG exclusively in Progressive format. The only drawback is that it works only on * nix-systems. If anyone can help me with this problem, please contact the PM.
It would be nice to make a GUI for my project, but I have no such knowledge, if anyone has the time and desire to implement the GUI, then write in a personal.