psd.js
psd.js copied to clipboard
Is it possible to convert psd tree data to a psd file?
// psd.tree().export()
const treeData = {
"children": [
{
"type": "layer",
"visible": true,
"opacity": 1,
"blendingMode": "normal",
"name": "test layer",
"left": 61,
"right": 307,
"top": 99,
"bottom": 216,
"height": 117,
"width": 246,
"text": {
"value": "hello world",
"font": {
"name": "STYuanti-SC-Bold",
"sizes": [120],
"colors": [
[
0,
0,
0,
255
]
],
"alignment": [
"center"
]
},
"left": 0,
"top": 0,
"right": 0,
"bottom": 0,
}
}
]
}
treeData[0].text.value = 'hello psd'
const PSD = require('psd')
PSD.createPsdFileSync(treeData, '/path/new.psd')
Not at this time. There's a significant amount of work involved in generating PSD's, and the exported tree data doesn't contain any image data anyways.
-- Ryan LeFevre (@meltingice) Sr. Software Engineer HODINKEE
From: Ethan Lai [email protected] Sent: Wednesday, September 27, 2017 7:49:09 AM To: meltingice/psd.js Cc: Subscribed Subject: [meltingice/psd.js] Is it possible to convert psd tree data to a psd file? (#106)
// psd.tree().export() const treeData = { "children": [ { "type": "layer", "visible": true, "opacity": 1, "blendingMode": "normal", "name": "test layer", "left": 61, "right": 307, "top": 99, "bottom": 216, "height": 117, "width": 246, "text": { "value": "hello world", "font": { "name": "STYuanti-SC-Bold", "sizes": [120], "colors": [ [ 0, 0, 0, 255 ] ], "alignment": [ "center" ] }, "left": 0, "top": 0, "right": 0, "bottom": 0, } } ] } treeData[0].text.value = 'hello psd' const PSD = require('psd') PSD.toPsdFile(treeData)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/meltingice/psd.js/issues/106, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAHtueEjr7VU51SRW-WYf9ddfHzXIZlVks5smjY1gaJpZM4Plo7U.
I need that too.. @oklai if you find anything that can export to psd, pls let me know!
+1
+1
@oklai can you please share how to generate the tree structure of the PSD? I'm looking to generate the PSD tree data structure from the PSD file.
Much thanks!