• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

Install and optimize the png file by using optipng

January 7, 2014 by Sharad Chhetri Leave a Comment

In this tutorial we will learn,how to install and optimize the png file by using optipng. Optimizing the png format file is very important, in terms of decreasing the website loading page time. If your website has a lots of png file,it may take time to load which also results in decreasing the webpage opening speed.
OptiPNG is a PNG optimizer that recompresses image files to a smaller size, without losing any information. This program also converts external formats (BMP, GIF, PNM and TIFF) to optimized PNG, and performs PNG integrity checks and corrections. (Reference from Optipng project link)

How to install optipng in CentOS/Red Hat/fedora

To install optipng in Red Hat based operating system,first we will install the EPEL repo.To learn about what is EPEL repo and how to install.Read our this post

Installation command syntax is: yum install optipng

In CentOS 5.x /Red Hat 5.x / Fedora

yum install wget
dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
yum install optipng

In CentOS 6.x and Red Hat 6.x

yum install wget
wget dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
yum install optipng

In Fedora

yum install optipng

How to install optipng in Ubuntu/Debian/Linux Mint

To install optipng in Debian based operating system,use the given below command

sudo apt-get update
sudo apt-get install optipng

Installing with optipng tarball

For installing from tarball,login with root or superuser

wget http://kaz.dl.sourceforge.net/project/optipng/OptiPNG/optipng-0.7.4/optipng-0.7.4.tar.gz

tar -xvzf optipng-0.7.4.tar.gz

cd optipng-0.7.4

./configure && make && make install

For installing optipng in Windows

Download the Windows setup zipped file from the prject link http://optipng.sourceforge.net/

Unzip the downloaded file and then run optipng.exe file.

How to optimize PNG file with optipng

Optimizing the PNG file by using optipng is very easy.You have to use the command optipng along with some options and path of PNG file.
Before optimizing file ,check its size.And after running the command,again check the size.You will get PNG file with reduced size

Examples: Use any one example.

optipng pic.png				(default speed)
optipng -o5 pic.png			(moderately slow)
optipng -o7 pic.png			(very slow)
optipng -i1 -o7 -v -full -sim pic.png

For more help and flags, run the command optipng --help

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. NOTICE: nagios.cmd file not found. Please specify the location of this file in your /etc/vshell.conf file
  2. How to convert rpm file into deb file
  3. Convert video file into gif file through command line in linux
  4. How to create iso file from CD/DVD and how to mount .iso file in folder
  5. Give permission reference to file/dir from other file/dir in linux
  6. group ownership reference to file/dir from other file/dir in linux
  7. Read the file inside compressed .gz files without extract
  8. The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form
  9. How to see line numbers in file through cat command
  10. How to create a file with cat command

Filed Under: Linux, Tips And Tricks

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Linux Commands

Allow only members of Wheel group to use su command on RHEL/CentOS

tr command to convert lines to space , tab and vertical tab

semanage command not found on CentOS 7 and RHEL 7

How to set motd in linux

How to free pagecache, dentries and inodes from memory on linux

How to make rm -fr command to be interactive

grep command to show lines after and before the keyword

Explore 70+ Articles On Linux Commands

Always Useful Tips And Tricks

How to install korn shell ksh in Linux

Replace keyword with its filename without extension : bash script

How to find when Operating system was installed in linux CentOS and Red Hat

How to forcefully send mail from mailq in sendmail MTA

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Convert video file into gif file through command line in linux

How to empty Trash through command line in Ubuntu

Explore 90+ Article On "Linux Tips And Tricks"

You Might Like These Articles!

Internal External Command

What is Linux/Unix Internal And External Command

Linux basic command

Linux Basic Commands For Every Beginner

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission but Schools and Colleges can do in their Private Network
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy