<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>png compression on Tutes Club</title><link>https://tutes.in/tag/png-compression/</link><description>Recent content in png compression on Tutes Club</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 02 Feb 2018 20:45:30 +0000</lastBuildDate><atom:link href="https://tutes.in/tag/png-compression/index.xml" rel="self" type="application/rss+xml"/><item><title>Compressing images directly on web server – Better Pagespeed tips</title><link>https://tutes.in/compressing-images-directly-on-web-server-better-pagespeed-tips/</link><pubDate>Fri, 02 Feb 2018 20:45:30 +0000</pubDate><guid>https://tutes.in/compressing-images-directly-on-web-server-better-pagespeed-tips/</guid><description>&lt;p&gt;for png, install on centos using command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;yum install optipng
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;for a single image&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;optipng -o5 filename.png
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;move to folder in which pngs are stored and use the following command:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;for i in *.png; do optipng -o7 -strip all -quiet &amp;#34;$i&amp;#34;; done
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;this will overwrite all pngs, o7 is switch for number of tries. o5 will be less time consuming though. -quiet makes it muted, outputs nothing.&lt;br&gt;
-strip all will try to remove all meta data.&lt;br&gt;
you can use -preserve to preserve the modification date.&lt;br&gt;
also try -keep, if you want to save backup of each file&lt;/p&gt;</description></item></channel></rss>