问题描述
有没有人知道将干净的矢量渲染成php图像然后将其作为jpeg / png提供的最佳方法?
Does anyone know of the best way to render clean vectors into a php image and then serve it as a jpeg/png?
具体来说我想绘制线条,多边形和样条曲线消除锯齿,然后将它们作为jpeg提供。最好在渲染时也使用alpha选项。
Specifically I want to draw lines, polygons and splines which are anti-aliased and then serve them up as jpegs. Preferably also with an alpha option when rendering.
具有与Raphael类似的API(没有动画)的php库是多么壮观 - 不仅因为Raphael有一个伟大的API,但也因为我已经在我的网站上使用它的动态位,但也需要并行烘焙jpeg的静态消费。
What would be spectacular is a php library with a similar API to Raphael (without the animation) - not only because Raphael has a great API but also because I'm already using it on my website for the dynamic bits but also need to bake jpeg's in parallel for static consumption.
推荐答案
Imagemagick适用于PHP。请参阅IMagickDraw类()。顺便说一句,AFAIK,JPEG中没有alpha选项,只有RGB颜色。
Imagemagick is available for PHP. See the IMagickDraw class (http://php.net/imagick). Btw, AFAIK, there is no alpha option in JPEG, only RGB colors.
这篇关于php有一个像样的矢量/样条库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!