github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

grosser / smusher

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 164
    • 8
  • Source
  • Commits
  • Network (8)
  • Issues (0)
  • Downloads (8)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (8)
    • v0.4.3
    • v0.4.2
    • v0.4.1
    • v0.4.0
    • v0.3.8
    • v0.3.7
    • v0.3.6
    • v0.3.5
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Ruby/CLI: Automatic lossless reduction of all your images — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Regenerated gemspec for version 0.4.3 
grosser (author)
Fri Jan 08 12:32:49 -0800 2010
commit  8e1cc0a0f2894c01338be00824538b3c285deba1
tree    2156e0aa4ed73b74e38473f3927901e4084aa513
parent  2346d0071c9ff3eec2013d1567bc5b038d610e04
smusher /
name age
history
message
file .gitignore Sat Jan 24 06:14:39 -0800 2009 now singleton + cmd-line interface... [grosser]
file README.markdown Fri Jan 08 12:32:26 -0800 2010 add .puny_png_api_key reading to get individual... [grosser]
file Rakefile Sun Nov 22 01:35:57 -0800 2009 gemcutter is default now hurray [grosser]
file VERSION Fri Jan 08 12:32:42 -0800 2010 Version bump to 0.4.3 [grosser]
directory bin/ Fri Oct 09 07:13:09 -0700 2009 reword readme, teaser for new feature [grosser]
directory lib/ Fri Jan 08 12:32:26 -0800 2010 add .puny_png_api_key reading to get individual... [grosser]
file smusher.gemspec Fri Jan 08 12:32:49 -0800 2010 Regenerated gemspec for version 0.4.3 [grosser]
directory spec/ Fri Jan 08 11:48:20 -0800 2010 use default punypng, and add api_key getter/setter [grosser]
README.markdown

LOSSLESS image size reduction for jpg, png and gif in the cloud

  • no image libraries needed, everything done in the interwebs
  • less size (up 97% saving) = faster downloads = less bandwidth + happy users

Install

install ruby + rubygems
sudo gem install smusher

Usage

Optimize a single image or a whole folder:

smusher /apps/x/public/images [options]
smusher /apps/x/public/images/x.png [options]
smusher /apps/x/public/images/*.png [options]

Options:

-q, --quiet                      no output
-c, --convert-gifs               convert gifs to PNGs
--service PunyPng                use PunyPng for image optimizing, instead of SmushIt
-v, --version                    display current version

Example

smusher /apps/ts/public/images
  smushing /apps/rs/public/images/social/facebook_icon.png
  2887 -> 132                              = 4%

  smushing /apps/rs/public/images/social/myspace_icon.png
  3136 -> 282                              = 8%

  smushing /apps/rs/public/images/dvd/dvd_1.png
  5045 -> 4                                = 0%
  reverted!
  ...

PunyPng - usage limit

The default Smusher::PunyPng.api_key is used by all users and could already be full when you try to smush some images.

Create a .puny_png_api_key in your home directory with your own api key from PunyPng.

Protection

Any image that returns a failure code, is larger than before, or is empty will not be saved.

TODO

  • only optimize 'new' images -> save time when doing on already optimized folder

JS + CSS

reduce images and minify css + js -> try reduce.

Authors

Contributors

  • retr0h

Michael Grosser
grosser.michael@gmail.com
Hereby placed under public domain, do what you want, just do not hold me accountable...

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server