Batch optimization of PNGs for iphone/ipad display as xcode does

后端 未结 7 1041

I\'m working on a magazine viewer for ipad and I\'m struggling with the performance.

I figured out that the most expensive part of displaying the pngs is the loading

7条回答
  •  离开以前
    2021-01-01 03:35

    I have been experimenting with pngnq, pngquant, pngcrush, optipng, etc.

    For my set of PNGs, I've achieved minimum file size with pngquant, pngnq and pngcrush

    Dir.glob("**/*.png").each do |file|
      ['pngnq -e .png -f', 'pngquant -f -speed 1 -ext .png', 'pngcrush'].each do |command|
        puts "#{command} #{file}"
        `#{command} #{file}`
      end
    end
    

    More details at: http://l4u.github.com/blog/2012/04/02/optimizing-file-sizes-of-png-images/

提交回复
热议问题