How to Use imageoptim in Middleman
Using imageoptim in middleman isn't very straightforward on ubuntu. Here is how I did it.
Install and Prepare the imageoptim Middleman Extension
Update ruby and install
gem update gem install middleman-imageoptim
configure :build do activate :imageoptim end
Install and Prepare the image_optim ruby gem
gem install image_optim
sudo apt-get install -y advancecomp gifsicle jhead jpegoptim libjpeg-progs optipng pngcrush pngquant
- Download the static linux binary from here. (I observed no real difference between the static vs. non-static)
- Extract it
- Open the
- rename the file to
Open a terminal at that location and run
sudo cp pngout /usr/bin
Now it should work! The optimization may take a while if you have a lot of images.