GithubHelp home page GithubHelp logo

anthrax3 / alfred-image-optim-workflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ramiroaraujo/alfred-image-optim-workflow

0.0 1.0 0.0 10.63 MB

License: MIT License

Ruby 6.04% PHP 65.71% Shell 28.25%

alfred-image-optim-workflow's Introduction

Image Optimization Workflow for Alfred app

This workflow brings a simple Alfred UI to the command line library image_optim from Ivan Kuchin. The library comes bundled with a nice pack of open source libraries as binaries to perform different types of optimizations.

The performed optimizations are lossy, which means that the original images will loose some (hardly noticeable) quality. Specifically, it's using pngquant to convert 24 bit pngs to 8 bits png with with full alpha channel, which usually reduces size of PNGs as much as 70% with hardly noticeable quality loss, and a JPEG compression algorithm called Smallfry which is similar of what JPEGmini uses.

I'll probably add options to select between lossy and lossless and maybe different compression methods in the future.

History

Originally this workflow used the ImageOptim-CLI library from Jamie Mason, which depends on ImageOptim, ImageAlpha and JPEGmini being installed on the system, JPEGmini being a paid app, and since it needs to manipulate JPEGmini with AppleScript, you needed to set the proper permissions for accessibility in your system preferences.

On the other side, the workflow was written in Ruby, which is beautiful and expressive, but I ended up having some problems with native extensions not being compiled exactly for the Ruby version shipped with OSX, which by the way changed from 1.8 to 2.0 from Mavericks forward. In the end, several times I needed to build 2 versions of the workflow for different OSX versions.

The original project is in the old-ruby-version branch.

Usage

  1. find or select one or more images or folders, show the file actions in Alfred, and select "Optimize Images". Note that any Alfred's way of selecting files work, such us:
  • select one or multiple files/folders in finder and press โŒ˜ alt \
  • browsing or finding files in Alfred, and triggering actions for the file
  • saving files in Alfred's file buffer, and then alt โ†’ to action buffered files.

File actions

  1. You'll see a notification indicating the number of files to process. Depending on the number and size of images, it could take a while.

Process start

  1. You'll see a progress notification roughly every 30 seconds, which can be muted (see below).

Progress

  1. When the optimization is completed, you'll see a final report notification with the saved size and percent.

Process finished

The proccess replaces the images with the optimized versions. Remember to save a copy or work with versioned files.

When the optimization process is running you can use the optimize progress keyword to see the progress, mute the process (avoid progress notifications) and cancel de process (stops process, leaves already optimized images as is).

Options

You cannot run this workflow if a previous process is still running. If you try to run it again, the optimize progress keyword is immediately fired to check on the current process instead.

Installation

Download the alfred-image-optim-workflow.alfredworkflow and import to Alfred 2.

Changelog

  • 2014-01-06 - Released
  • 2014-01-23 - Added folder support, and correctly counting number of files inside folders
  • 2015-08-28 - Rebuild workflow around image_optim cli library from Ivan Kuchin and use PHP instead of Ruby

alfred-image-optim-workflow's People

Contributors

ramiroaraujo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.