Optipng Filter

today, i added optipng filter. this is the coolest way i guess.

gist: 1655310

in this case, i added sample file and check their file sizes...

before before before => 88,152 bytes

after after after => 45,715 bytes

newest nanoc can compile once and skip after.

usage is adding filter :optipng, :level => 2(between 0 and 7) to your Rules file.

but i don't add filtering binaries, so you should do that...

if item.binary?
  case item[:extension]
  when 'png'
    filter :optipng, :level => 2
  end
end

this trick is from guides

hopefully enjoy!

Home