Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com

This Blog is protected by DMCA.com

huuphan.com. Powered by Blogger.

How to Image compression faster web pages

Web developers want to fast loading web pages. How to optimize image for web site with PNGs image. I using Linux operating system.


Checking load web page

I am use Browser Calories plugin add-ons to check web page.

Web optimization

Installing the tool gimp, imagemagick and optipng

[[email protected] DR]$ sudo yum install gimp ImageMagick optipng

Step 1: Get some basic information about Image

Using the file command to get some information about this image

[[email protected] Banner]$ file Devopsroles.png

The screen output terminal
Devopsroles.png: PNG image data, 512 x 512, 8-bit/color RGBA, non-interlaced

Using identify command get some basic information about image
[[email protected] Banner]$ identify Devopsroles.png

The screen output terminal
Devopsroles.png PNG 512x512 512x512+0+0 8-bit sRGB 27579B 0.000u 0:00.000

Step 2: Run optipng command to losslessly optimize your images.
[[email protected] Banner]$ optipng -o7 Devopsroles.png

The screen output terminal
** Processing: Devopsroles.png
512x512 pixels, 4x8 bits/pixel, RGB+alpha
Input IDAT size = 27428 bytes
Input file size = 27579 bytes

Trying:
  zc = 9  zm = 9  zs = 0  f = 0        IDAT size = 22416
                              
Selecting parameters:
  zc = 9  zm = 9  zs = 0  f = 0        IDAT size = 22416

Output IDAT size = 22416 bytes (5012 bytes decrease)
Output file size = 22531 bytes (5048 bytes = 18.30% decrease)

Note: The option -o7 is the slowest to process.

You can resize all the PNGs in a directory
$ optipng -o7 -dir=/path/to/directory/ *.png

 

Conclusion

Thought the article, you have "How to Image compression faster web pages" as above" . I hope will this your helpful.

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com