<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>imagemagick on Aldrin Jenson</title>
    <link>/tags/imagemagick/</link>
    <description>Aldrin Jenson (imagemagick)</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 01 Mar 2024 12:00:00 -0400</lastBuildDate>
    
    <atom:link href="/tags/imagemagick/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Compressing images from the CLI</title>
      <link>/til/compressing-images-from-the-cli/</link>
      <pubDate>Fri, 01 Mar 2024 12:00:00 -0400</pubDate>
      
      <guid>/til/compressing-images-from-the-cli/</guid>
      <description>&lt;h3 id=&#34;steps&#34;&gt;Steps&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Move all your image files to a folder&lt;/li&gt;
&lt;li&gt;calculate it&amp;rsquo;s folder size using &lt;code&gt;du&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;create a copy of the folder.&lt;/li&gt;
&lt;li&gt;install imagemagick&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;brew install imagemagick&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;in this folder, perform the following actions:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mkdir compressed
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; i in *; &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; convert $i -resize 40% compressed/$i; &lt;span style=&#34;color:#66d9ef&#34;&gt;done&lt;/span&gt;;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The above will compress all images by making the size 40% of the initial size and will move it to a folder called &lt;code&gt;compressed&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check folder structure again using &lt;code&gt;du&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;if it&amp;rsquo;s still too much, repeat again but this time reduce quality to even lower&lt;/li&gt;
&lt;/ul&gt;
</description>
    </item>
    
  </channel>
</rss>
