Png compression and image resizing

非 Y 不嫁゛ 提交于 2019-11-28 09:23:42

问题


Is there a way / plugin to help the image resizer with png compression?

I have a png image that I use in navigation and would like to keep it as small as possible. The original image has width 200px and size 38kb. I need to resize it down to 150px. Once I do so using the image resizer the size goes up to 150kb.

Originally the image was compressed using http://tinypng.org/


回答1:


Yes, the PrettyGifs plugin offers excellent octree quantization for both PNG and GIF images.

Use &colors=256, &colors=128, etc to adjust the bit depth. You can also preserve the existing color palette with preservePalette=true.

Note that advanced PNG compression optimizations (such as offered by smush.it, tinypng, etc) require an additional 150-400MB of RAM and take 10-20 seconds to perform - for obvious reasons you wouldn't want that to happen during a dynamic request. ImageResizer tries to finish each request under 250ms.

Hand-optimizing PNG/GIF CSS sprites and site-wide icons is usually going to give you a smaller file size that ImageResizer can, although it's nearly impossible to beat for photographic data.

Of course, with the WebP plugin installed, ImageResizer will wipe the floor with the competition.



来源:https://stackoverflow.com/questions/17829200/png-compression-and-image-resizing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!