目录
article
guizang-social-card-render 小红书高清渲染技能
功能说明
搭配 guizang-social-card-skill 生成的小红书卡片网页,自动化渲染超高 DPI 无损 PNG 图片,解决浏览器截图模糊、文字发虚问题,输出小红书专用 3:4 竖版高清图。
环境依赖
- Node.js >= 16
- 安装依赖
npm install playwright-chromium
npx playwright install chromium
调用方式
1. 基础调用(3倍超高清,默认尺寸)
node render.js htmlPath=./card/index.html outputPath=./output/笔记 1.png
2. 2倍高清、自定义尺寸
node render.js htmlPath=./card/index.html scale=2 width=1500 height=2000 outputPath=./output/笔记 2.png
参数说明
- htmlPath:必填,小红书卡片HTML文件路径
- scale:缩放倍数,2=高清,3=印刷级超清
- width/height:画布基准尺寸,严格保持3:4最佳
- outputPath:图片输出路径,不存在目录自动创建
配套使用流程
- 先用 guizang-social-card-skill 生成小红书卡片 index.html
- 调用本渲染skill传入HTML路径
- 自动生成无损高清PNG,直接上传小红书无压缩糊图
备用无代码方案(无Node环境时)
- Chrome打开HTML文件
- PixPin截图工具,开启3倍输出缩放,框选卡片保存PNG
- 或Chrome扩展 Full Page Screen Capture 开启高DPI导出