<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dimitri Nicolas</title>
    <description>The latest articles on DEV Community by Dimitri Nicolas (@dimitrinicolas).</description>
    <link>https://dev.to/dimitrinicolas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F84097%2F213a85b5-413e-4563-87af-3f30f2d10db7.jpg</url>
      <title>DEV Community: Dimitri Nicolas</title>
      <link>https://dev.to/dimitrinicolas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dimitrinicolas"/>
    <language>en</language>
    <item>
      <title>Learn How to Automate your Image Optimization Process with Lepto</title>
      <dc:creator>Dimitri Nicolas</dc:creator>
      <pubDate>Mon, 06 Aug 2018 09:11:59 +0000</pubDate>
      <link>https://dev.to/dimitrinicolas/learn-how-to-automate-your-image-optimization-process-with-lepto-890</link>
      <guid>https://dev.to/dimitrinicolas/learn-how-to-automate-your-image-optimization-process-with-lepto-890</guid>
      <description>&lt;p&gt;Optimizing images is a long duty, maybe you’re already using imagemin or ImageOptim, they’re great tools, but it can seem difficult to automate their usage.&lt;/p&gt;

&lt;p&gt;When you want to optimize your images for the web, you have plenty of tasks to do like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Resizing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating different resolution files (for Retina screens)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimizing (removing metadata)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Compressing&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create better format alternatives (like WebP)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’re already compiling our JavaScript and CSS through module bundlers and pre/post-processors, here comes a new build step: image processing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started with Lepto
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/leptojs/lepto" rel="noopener noreferrer"&gt;github.com/leptojs/lepto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lepto is a Node.js module and Command Line Interface responsible for &lt;strong&gt;editing, optimizing and analyzing&lt;/strong&gt; images resources. So let’s get started!&lt;/p&gt;

&lt;p&gt;First of all, you will &lt;strong&gt;need to have an “npm initialized project”&lt;/strong&gt;. If not, run the command &lt;code&gt;npm init&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You will also need to install the CLI tool as a dev dependency:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install -D lepto-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you’re &lt;strong&gt;too lazy to collect some ordinary images&lt;/strong&gt;, I give you some that &lt;a href="https://gist.github.com/dimitrinicolas/766eecec10adf4deb6a20c8002df4f2b" rel="noopener noreferrer"&gt;you can download on this gist&lt;/a&gt;, simply click on the “Download ZIP” button and put those resources into an “assets” directory.&lt;/p&gt;

&lt;p&gt;Then you have to create your configuration file named &lt;code&gt;lepto.config.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"assets"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"output"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"assets/output"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"watch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"filters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"glob"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"**/*.*"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"use"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lepto.jpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"quality"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lepto.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"quality"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;75&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create a new npm script named like &lt;code&gt;build&lt;/code&gt; into your &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lepto"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, by running the command &lt;code&gt;npm run build&lt;/code&gt;, Lepto will compress all jpg and png from your “assets” directory and export them into the output directory. By setting the &lt;code&gt;watch&lt;/code&gt; option to &lt;code&gt;true&lt;/code&gt;, Lepto will watch for every single change inside the “assets” directory to relaunch the process.&lt;/p&gt;

&lt;p&gt;By default, Lepto comes with zero configuration, so you need to &lt;strong&gt;write a list of &lt;code&gt;filters&lt;/code&gt;&lt;/strong&gt; each of them associated with a &lt;code&gt;glob&lt;/code&gt; and a list of plugins to &lt;code&gt;use&lt;/code&gt;. In this configuration file example, we ask Lepto to compress all jpg and png files with a quality of 75.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feknwlfa9frhhearp3k5v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feknwlfa9frhhearp3k5v.png" alt="lepto command running" width="800" height="342"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Let’s add some plugins
&lt;/h2&gt;

&lt;p&gt;Now, you would like to resize your images. There is a plugin for that: &lt;a href="https://github.com/leptojs/lepto-resize" rel="noopener noreferrer"&gt;&lt;code&gt;lepto-resize&lt;/code&gt;&lt;/a&gt;, you will have to install it like that:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ npm install -D lepto-resize
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Then we’ll add a new filter in our Lepto config:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"glob"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"**/*.{jpg,jpeg}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"use"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lepto-resize"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"maxWidth"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;All your jpgs have now a width less or equal to 1200px. You can discover way more options to use with &lt;a href="https://github.com/leptojs/lepto-resize" rel="noopener noreferrer"&gt;&lt;code&gt;lepto-resize&lt;/code&gt;&lt;/a&gt; on the repository: &lt;a href="https://github.com/leptojs/lepto-resize" rel="noopener noreferrer"&gt;github.com/leptojs/lepto-resize&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Let’s add another filter to create Retina’s versions of our png:
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"glob"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"**/*.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"use"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lepto-resize"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"retina"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now we can easily insert them into our html using &lt;code&gt;srcset&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"assets/output/icon.png,
             assets/output/icon@2x.png 2x,
             assets/output/icon@3x.png 3x"&lt;/span&gt;
     &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"assets/output/icon.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Icon alt"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I’m pretty sure that you are now capable of adding the plugin &lt;a href="https://github.com/leptojs/lepto-webp" rel="noopener noreferrer"&gt;&lt;code&gt;lepto-webp&lt;/code&gt;&lt;/a&gt; to create WebP alternatives of your jpgs! Check out the documentation here: &lt;a href="https://github.com/leptojs/lepto-webp" rel="noopener noreferrer"&gt;github.com/leptojs/lepto-webp&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Using the GUI
&lt;/h2&gt;

&lt;p&gt;For having the best-optimized images, we also need to carefully choose the best suitable quality percentage for each of them.&lt;/p&gt;

&lt;p&gt;By default, the GUI is accessible on the port 4490, so let’s run &lt;code&gt;npm run build&lt;/code&gt; and go on &lt;a href="http://localhost:4490/" rel="noopener noreferrer"&gt;localhost:4490&lt;/a&gt;. We’ll get this beautiful interface composed of three parts: your input files list, your filters list and finally the optimizer waiting for a file selection.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gmuqhkjgzl1krhqgvb4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6gmuqhkjgzl1krhqgvb4.png" alt="Lepto Graphical User Interface" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let’s select a file in the list: it is now displayed it the optimizer, letting us play with the quality slider and see the output in real-time. When you’re satisfied with a quality percentage, &lt;strong&gt;click on the button “Add optimization plugin”&lt;/strong&gt; and &lt;strong&gt;save this new configuration by clicking on “Save config”&lt;/strong&gt; (or press ⌘S / Ctrl+S).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyv9p1fga66d1p5jjk0d6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyv9p1fga66d1p5jjk0d6.png" alt="Lepto GUI optimizer usage" width="800" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By adding an “optimization plugin” the GUI is simply creating a new filter with a glob equal to the file name, and the plugin corresponding to the file extension:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"glob"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"001.jpg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"use"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lepto.jpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"quality"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Be sure to keep those specific filters at the end of the list.&lt;/p&gt;
&lt;h2&gt;
  
  
  To go even further
&lt;/h2&gt;

&lt;p&gt;The use cases for this tool are endless. You can even &lt;strong&gt;automatically collect the vibrant colors of your images&lt;/strong&gt; and get them into a single JSON file with the &lt;a href="https://github.com/leptojs/lepto-vibrant-color" rel="noopener noreferrer"&gt;&lt;code&gt;lepto-vibrant-color&lt;/code&gt;&lt;/a&gt; plugin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso27sord8gvi3x972x6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fso27sord8gvi3x972x6z.png" alt="lepto-vibrant-color extraction example" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To learn more about Lepto, check out the &lt;code&gt;lepto&lt;/code&gt; and &lt;code&gt;lepto-cli&lt;/code&gt; documentations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/leptojs/lepto" rel="noopener noreferrer"&gt;github.com/leptojs/lepto&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/leptojs/lepto-cli" rel="noopener noreferrer"&gt;github.com/leptojs/lepto-cli&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To learn even more about the best image optimization practices I recommend you the “&lt;a href="https://images.guide/" rel="noopener noreferrer"&gt;Essential Image Optimization&lt;/a&gt;” guide by &lt;a href="https://twitter.com/addyosmani" rel="noopener noreferrer"&gt;Addy Osmani&lt;/a&gt;: &lt;a href="https://images.guide/" rel="noopener noreferrer"&gt;images.guide&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  About me
&lt;/h2&gt;

&lt;p&gt;I’m a French student, enthusiast of front-end development for several years now. By creating Lepto, I tried my best to make a non-frustrating and efficient tool to easily manage image optimization. Building a Command Line Interface was obvious for performance and ease of use reason (see &lt;a href="https://brandur.org/interfaces" rel="noopener noreferrer"&gt;this great article about Terminal and design&lt;/a&gt; by &lt;a href="https://twitter.com/brandur" rel="noopener noreferrer"&gt;Brandur&lt;/a&gt;). However, the GUI was necessary for choosing the best compression quality. So I came to this great harmony.&lt;/p&gt;

&lt;p&gt;I am listening to all suggestions, discussions and violent criticism via &lt;a href="https://twitter.com/dimitrincls" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt; or via e-mail: &lt;a href="//mailto:dimitri@ooeo.fr"&gt;dimitri@ooeo.fr&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading! 😄&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/dimitrinicolas" rel="noopener noreferrer"&gt;
        dimitrinicolas
      &lt;/a&gt; / &lt;a href="https://github.com/dimitrinicolas/lepto" rel="noopener noreferrer"&gt;
        lepto
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Automated image Editing, Optimization and Analysis via CLI and a web interface. You give to lepto your input and output directories, the plugins you want to use and their options. Then lepto does his job, you keep your original files and the structure of the input directory. Some plugins can even collect data (like primary colors) from your images and save them in a JSON file.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://github.com/dimitrinicolas/lepto#get-started-with-cli--npm-scripts" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fdimitrinicolas%2Fleptofixtures%2Freadme%2Flepto.jpg" alt="Lepto: The best image optimizations practices made simple"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://travis-ci.org/leptojs/lepto" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/4033a307095cc3572919be7527dece2deaedb219ae5a7da73167213708d364c6/68747470733a2f2f7472617669732d63692e6f72672f6c6570746f6a732f6c6570746f2e7376673f6272616e63683d6d6173746572" alt="Build Status"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;The main purpose of this tool is to automate image optimization and analysis
This project is recent, so use it with care, I'm listening to all feedback (we
can talk via &lt;a href="https://twitter.com/dimitrincls" rel="nofollow noopener noreferrer"&gt;twitter&lt;/a&gt;, don't follow me I never tweet).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is the difference with &lt;a href="https://github.com/imagemin/imagemin" rel="noopener noreferrer"&gt;ImageMin&lt;/a&gt;?&lt;/strong&gt; I think that if you deal
with large applications, then go on ImageMin, but if you are building small
static websites and you want to optimize your resources easily, then you could
try lepto.&lt;/p&gt;
&lt;p&gt;You give to lepto your input and output directories, the plugins you want to
use and their options. Then lepto does his job, you keep your original files
and the structure of the input directory. Some plugins can even collect data
(like primary colors) from your images and save them in a JSON file.&lt;/p&gt;
&lt;p&gt;If you want to learn more about image optimizations, I recommend to you the
amazing &lt;a href="https://images.guide/" rel="nofollow noopener noreferrer"&gt;images.guide&lt;/a&gt;…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/dimitrinicolas/lepto" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>opensource</category>
      <category>optimization</category>
    </item>
  </channel>
</rss>
