Comments (1)
html2canvas 的原理是通过 JS 解析目标 DOMTree 然后“翻译”成 Canvas 语法绘制,借由 Canvas API 出图。有几个明显缺点,比如绘制成 Canvas 后图片可能会失真(锯齿、模糊等情况),比如有很多 CSS 特性不支持(如渐变色、文字特效等需要额外开发),还有画布中使用了 SVG 等元素解析困难,所以前端出图在应对复杂场景时工作量难以预估,只有在特别简单的场景下:例如只有图片和最简单的文字构成的海报可以考虑从前端直接出图。服务端 Chrome 截图方式没有这种”翻译“的过程,相当于直接将浏览器作为渲染引擎,能在最少开发成本下保证出图准确性和质量。
其它:稿定设计出图方案参考
from poster-design.
Related Issues (20)
- [求助]生成的图片分页问题 HOT 2
- 打开模板后未编辑就点其它模板时,会出现确认提示 HOT 2
- 小尺寸画布添加元素,比例问题
- Question: Regarding the use of personal templates HOT 1
- screenshot服务基于howard86/puppeteer_node:12镜像部署,截图效果不好 HOT 1
- AIGC(动漫风格大模型)的前端页面 HOT 2
- 截图,字体加载可能导致有 loading 问题 HOT 6
- AI 智能抠图小建议
- Export "default" of module "src/stores/aiDesign/design/widget/index.ts" was reexported through module "src/stores/aiDesign/index.ts"
- 选择字体列表,被画布的滚动条遮挡了 HOT 3
- 模板筛选时,选择全部,但筛选列表还是高亮选中上一个筛选条件
- 有什么办法将公开的素材转为fabric的json格式? HOT 1
- AI 智能抠图的画笔大小,调节大小没有效果 HOT 2
- 是否可以支持DOCKER?
- 保存接口与取出数据格式不一致 HOT 2
- Github Push cannot contain secrets
- 报错:历史记录功能已重构,该方法即将移除:pushHistory HOT 1
- 有无可能导出html? HOT 2
- 对元素缩放时,选中框有几条边超出边框了,是bug? HOT 1
- 字体是免费开源的么? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poster-design.