ruby 有没有去除图片的白边技巧?
高洛峰
高洛峰 2017-04-21 10:56:32
0
3
715

利用ruby+rmagick对图片进行处理,
现有png图片若干,背景为透明色的.
每张图片都有很多的白边,并且这些白边是没有用的.
存在就是浪费资源.想问问大家有没有什么好的方法来处理这个白边.这样的话就会节约些资源

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
阿神

If you want to automatically recognize the white edges, you may have to write your own recognition algorithm. ImageMagick doesn't have much support for such needs.

Peter_Zhu

Yes, img_obj.trim(!)

洪涛

Try it with crop

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!