All Projects → funbox → Optimizt

funbox / Optimizt

Licence: mit
CLI image optimization tool

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Optimizt

Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (+925.93%)
Mutual labels:  webp, svg, gif, png, jpeg
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (-25.59%)
Mutual labels:  webp, svg, gif, png, jpeg
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (-44.28%)
Mutual labels:  svg, gif, png, jpeg, image-compression
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (+591.41%)
Mutual labels:  webp, gif, png, jpeg
imagor
Fast, Docker-ready image processing server in Go and libvips
Stars: ✭ 2,276 (+283.16%)
Mutual labels:  png, jpeg, gif, webp
Pyecharts Snapshot
renders the output of pyecharts as png, jpeg, gif, svg, eps, pdf and raw base64
Stars: ✭ 142 (-76.09%)
Mutual labels:  svg, gif, png, jpeg
Nuxt Optimized Images
🌅🚀 Automatically optimizes images used in Nuxt.js projects (JPEG, PNG, SVG, WebP and GIF).
Stars: ✭ 717 (+20.71%)
Mutual labels:  webp, svg, gif, jpeg
gfxprim
Open-source modular 2D bitmap graphics library with emphasis on speed and correctness.
Stars: ✭ 32 (-94.61%)
Mutual labels:  png, jpeg, gif, webp
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+3457.41%)
Mutual labels:  webp, svg, png, jpeg
Pixterm
Draw images in your ANSI terminal with true color
Stars: ✭ 782 (+31.65%)
Mutual labels:  webp, gif, png, jpeg
Sdwebimage
Asynchronous image downloader with cache support as a UIImageView category
Stars: ✭ 23,928 (+3928.28%)
Mutual labels:  webp, gif, png, jpeg
sail
The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software
Stars: ✭ 206 (-65.32%)
Mutual labels:  png, jpeg, gif, webp
Essential Image Optimization
Essential Image Optimization - an eBook
Stars: ✭ 1,950 (+228.28%)
Mutual labels:  gif, png, jpeg, image-compression
Imageprocessor
📷 A fluent wrapper around System.Drawing for the processing of image files.
Stars: ✭ 2,452 (+312.79%)
Mutual labels:  webp, gif, png, jpeg
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+28.28%)
Mutual labels:  webp, gif, png, jpeg
Lilliput
Resize images and animated GIFs in Go
Stars: ✭ 1,690 (+184.51%)
Mutual labels:  webp, gif, png, jpeg
Automator Workflows
A collection of Automator workflows (services) that speed up your design / development process. Compatible with LaunchBar 6 and 7 Actions
Stars: ✭ 439 (-26.09%)
Mutual labels:  webp, svg, png, jpeg
zImageOptimizer
Simple image optimizer for JPEG, PNG and GIF images on Linux, MacOS and FreeBSD.
Stars: ✭ 108 (-81.82%)
Mutual labels:  png, jpeg, image-compression
StbSharp
C# port of the famous C framework
Stars: ✭ 62 (-89.56%)
Mutual labels:  png, jpeg, gif
Mort
Storage and image processing server written in Go
Stars: ✭ 420 (-29.29%)
Mutual labels:  webp, png, jpeg

@funboxteam/optimizt

Optimizt avatar: OK sign with Mona Lisa picture between the fingers

npm

Optimizt is a CLI tool that helps you prepare images during frontend development.

It can compress PNG, JPEG, GIF and SVG lossy and lossless and create AVIF and WebP versions for raster images.

По-русски

Rationale

As frontend developers we have to care about pictures: compress PNG & JPEG, remove useless parts of SVG, create AVIF and WebP for modern browsers, etc. One day we got tired of using a bunch of apps for that, and created one tool that does everything we want.

Usage

Install the tool:

npm i -g @funboxteam/optimizt

Optimize!

optimizt path/to/picture.jpg

Command line flags

  • --avif — create AVIF versions for the passed paths instead of compressing them.
  • --webp — create WebP versions for the passed paths instead of compressing them.
  • -l, --lossless — optimize losslessly instead of lossily.
  • -v, --verbose — show additional info, e.g. skipped files.
  • -V, --version — show tool version.
  • -h, --help — show help.

Examples

# one image optimization
optimizt path/to/picture.jpg

# list of images optimization losslessly
optimizt --lossless path/to/picture.jpg path/to/another/picture.png

# recursive AVIF creation in the passed directory
optimizt --avif path/to/directory

# recursive WebP creation in the passed directory
optimizt --webp path/to/directory

# recursive JPEG optimization in the current directory
optimizt `find . -type f -name '*.jpg'`

Integrations

External Tool in WebStorm, PhpStorm, etc

Add an External Tool

Open Preferences → Tools → External Tools and add a new tool with these options:

  • Program: path to the exec file (usually simply optimizt)
  • Arguments: desired ones, but use $FilePath$ to pass Optimizt the path of the selected file or directory
  • Working Directory: $ContentRoot$
  • Synchronize files after execution: ✔️

Set other options at your discretion. For example:

As you see on the screenshot above, you may add several “external tools” with the different options passed.

How to use

Run the tool through the context menu on a file or directory:

Shortcuts

To add shortcuts for the added tool go to Preferences → Keymap → External Tools:

Tasks in Visual Studio Code

Add Task

Run >Tasks: Open User Tasks from the Command Palette.

In an open file, add new tasks to the tasks array, for example:

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "optimizt: Optimize Image",
      "type": "shell",
      "command": "optimizt",
      "args": [
        "--verbose",
        {
          "value": "${file}",
          "quoting": "strong"
        }
      ],
      "presentation": {
        "echo": false,
        "showReuseMessage": false,
        "clear": true
      }
    },
    {
      "label": "optimizt: Optimize Image (lossless)",
      "type": "shell",
      "command": "optimizt",
      "args": [
        "--lossless",
        "--verbose",
        {
          "value": "${file}",
          "quoting": "strong"
        }
      ],
      "presentation": {
        "echo": false,
        "showReuseMessage": false,
        "clear": true
      }
    },
    {
      "label": "optimizt: Create WebP",
      "type": "shell",
      "command": "optimizt",
      "args": [
        "--webp",
        "--verbose",
        {
          "value": "${file}",
          "quoting": "strong"
        }
      ],
      "presentation": {
        "echo": false,
        "showReuseMessage": false,
        "clear": true
      }
    },
    {
      "label": "optimizt: Create WebP (lossless)",
      "type": "shell",
      "command": "optimizt",
      "args": [
        "--webp",
        "--lossless",
        "--verbose",
        {
          "value": "${file}",
          "quoting": "strong"
        }
      ],
      "presentation": {
        "echo": false,
        "showReuseMessage": false,
        "clear": true
      }
    }
  ]
}

How to use

  1. Open the file for processing using Optimizt, it should be in the active tab.
  2. Run >Tasks: Run Task from the Command Palette.
  3. Select the required task.

Shortcuts

You can add shortcuts for a specific task by run >Preferences: Open Keyboard Shortcuts (JSON) from the Command Palette.

An example of adding a hotkey to run the "optimizt: Optimize Image (lossless)" task:

// Place your key bindings in this file to override the defaults
[
  {
    "key": "ctrl+l",
    "command": "workbench.action.tasks.runTask",
    "args": "optimizt: Optimize Image (lossless)"
  }
]

Plugin for Sublime Text 3

You’ll find the user settings directory in one of the following paths:

  • macOS: ~/Library/Application Support/Sublime Text 3/Packages/User
  • Linux: ~/.config/sublime-text-3/Packages/User
  • Windows: %APPDATA%\Sublime Text 3\Packages\User

Add plugin

Inside the settings directory create a file optimizt.py with the following content:

import os
import sublime
import sublime_plugin

optimizt = "~/.nodenv/shims/optimizt"

class OptimiztCommand(sublime_plugin.WindowCommand):
  def run(self, paths=[], options=""):
    if len(paths) < 1:
      return

    safe_paths = ["\"" + i + "\"" for i in paths]
    shell_cmd = optimizt + " " + options + " " + " ".join(safe_paths)
    cwd = os.path.dirname(paths[0])

    self.window.run_command("exec", {
      "shell_cmd": shell_cmd,
      "working_dir": cwd
    })

Specify path to executable inside optimizt variable, this path can be obtained by running command -v optimizt (on *nix) or where optimizt (on Windows).

Integrate the plugin into the sidebar context menu

Inside the settings directory create a file Side Bar.sublime-menu with the following content:

[
    {
        "caption": "Optimizt",
        "children": [
          {
              "caption": "Optimize Images",
              "command": "optimizt",
              "args": {
                "paths": [],
                "options": "--verbose"
              }
          },
          {
              "caption": "Optimize Images (lossless)",
              "command": "optimizt",
              "args": {
                "paths": [],
                "options": "--lossless --verbose"
              }
          },
          {
              "caption": "Create WebP",
              "command": "optimizt",
              "args": {
                "paths": [],
                "options": "--webp --verbose"
              }
          },
          {
              "caption": "Create WebP (lossless)",
              "command": "optimizt",
              "args": {
                "paths": [],
                "options": "--webp --lossless --verbose"
              }
          }
        ]
    }
]

How to use

Run the tool through the context menu on a file or directory:

Troubleshooting

“spawn jpegoptim ENOENT”, “spawn guetzli ENOENT”, etc

Make sure that the ignore-scripts option is not active.

More info: #9.

“Cannot find libjpeg”, “pkg-config: command not found”, “fatal error: 'png.h' file not found”, etc

Some operating systems may lack of required libraries and utils, so you need to install them.

Example (on macOS via Homebrew):

brew install pkg-config jpeg libpng

Credits

Cute picture for the project was made by Igor Garybaldi.

Sponsored by FunBox

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].