Text Layers
This is an issue to track the development of the implementation of text layers
has there been no progress in editing text layers ? this was one feature I was looking forward to
A bit of both, I've been primarily working towards smart objects and adjustment layers which have so far added the following features:
- descriptor parsing
- rendering framework
- compositing framework
So I do think its possible to once those are merged get this done fairly quickly as those are the main blocking points
alright , I'll be happy to help in whatever way I can if needed
Thanks! Seeing as this and the smart objects have been requested while adjustment layers not so much I will prioritize text layers over adjustment layers for the .6 release
Thanks! Seeing as this and the smart objects have been requested while adjustment layers not so much I will prioritize text layers over adjustment layers for the .6 release
wow thanks
Hey @algo-uno-10 now that smart objects are in the API I started looking into this and unfortunately, as with many things photoshop related this isnt as trivial as initially assumed.
Theres a couple of road blocks/features that are needed to make this work:
- Parser for
EngineDatawhich seems to be some postscript derived dict-like format for storing the text information - Decoding the layer-local and global text info (around 500 lines of variables for each of these encoded as
EngineData - Reading these text properties
- Writing them
- Rendering the text to an image buffer
- Implementing warps
Likely this will take a couple of months to reverse engineer so I first wanted to ask you what would be your intended use case so I can prioritize adding support for these step by step
Recording for my own sake:
Replacing of text data seems to only matter if we do it on the global Txt2 Tagged block, this will make photoshop prompt you to redraw the image data. The others seem to have no effect on this
Hey @algo-uno-10 now that smart objects are in the API I started looking into this and unfortunately, as with many things photoshop related this isnt as trivial as initially assumed.
Theres a couple of road blocks/features that are needed to make this work:
- Parser for
EngineDatawhich seems to be some postscript derived dict-like format for storing the text information- Decoding the layer-local and global text info (around 500 lines of variables for each of these encoded as
EngineData- Reading these text properties
- Writing them
- Rendering the text to an image buffer
- Implementing warps
Likely this will take a couple of months to reverse engineer so I first wanted to ask you what would be your intended use case so I can prioritize adding support for these step by step
my intended usecase was : a .psd template having layers of texts images etc. all I want to do is edit the text inside the template programmatically . sry for late reply
No worries, would you need the text to be redrawn or would it be ok if photoshop gives a warning on open saying the layers are out of date?
No worries, would you need the text to be redrawn or would it be ok if photoshop gives a warning on open saying the layers are out of date?
the last lib I used was ag-psd which did the same , the image had to be opened in photoshop and then exported . I was looking for text redraw and exported directed to image format programmatically
Thanks for the info, I'll look into how ag-psd did their text replacement first and work on the other stuff after. It's definitely planned to be able to export the image from it but it will likely take some time
First of all, thanks for your hard work. I have another use case. I have a psd file that has both text layer and image layer. I only want to replace the data of the image layer and keep the text layer unchanged. However, after I replaced the image layer, I found that the text layer became an all-white pixel(image) layer, the text is all lost. Is there any way to solve this problem?
Thanks.
Hey @wellitecho, unfortunately that is the 'expected' behaviour. We currently don't have roundtripping for text layers so they just get written out again as a generic layer rather than what they came in as. However I do think until we've got full support for all layers this would be a valuable thing to have and shouldn't be too complicated to implement (as we do parse the information and could just dump it back out again).
Do you mind creating a ticket to track this? FYI I am out until start of may on vacation so I'll only get around to it after that.
@EmilDohne Thanks for your quick reply. I created #141 for this. If you think there is any problem, feel free to edit the issue.
Hey @algo-uno-10 now that smart objects are in the API I started looking into this and unfortunately, as with many things photoshop related this isnt as trivial as initially assumed.
Theres a couple of road blocks/features that are needed to make this work:
- Parser for
EngineDatawhich seems to be some postscript derived dict-like format for storing the text information- Decoding the layer-local and global text info (around 500 lines of variables for each of these encoded as
EngineData- Reading these text properties
- Writing them
- Rendering the text to an image buffer
- Implementing warps
Likely this will take a couple of months to reverse engineer so I first wanted to ask you what would be your intended use case so I can prioritize adding support for these step by step
Hey, i found this https://github.com/layervault/psd-enginedata Would this help? It's in ruby so it's kind of beyond my scope
Hey @Deathstroke751, thanks a lot for the link :) I had found that one myself as well and its definitely very helpful although I don't know any ruby either.
Hi, I'm very much interested in being able to modify the text layers in a PSD. Context: in the Marvel Champions cardgame community we create fanmade cards in PSD format. I have a python code that reads them using psd-tools to extract the information from the different layers and save that to different databases (for online play for example). It works great as long as I just need to read a file... Next, I would love to be able to modify the text of a file to automatize stuff (like card number and more). psd-tools does not support text modification, and doesn't support some effects such as Outer Glow for example... I was hoping your library might help me but if I am correct the text layers are still not accessible, is that the case?
Hi, I'm very much interested in being able to modify the text layers in a PSD. Context: in the Marvel Champions cardgame community we create fanmade cards in PSD format. I have a python code that reads them using psd-tools to extract the information from the different layers and save that to different databases (for online play for example). It works great as long as I just need to read a file... Next, I would love to be able to modify the text of a file to automatize stuff (like card number and more). psd-tools does not support text modification, and doesn't support some effects such as Outer Glow for example... I was hoping your library might help me but if I am correct the text layers are still not accessible, is that the case?
It's not that difficult a project, just use canvas or something similar
@EmilDohne Hi, what difficulties are you facing now, maybe you need some help?
Hey @bertou, thank you for being interested in the project! Unfortunately this is not yet possible in the PhotoshopAPI but is planned to come in the future. For the time being I would suggest writing a script in photoshop itself using something like this: https://github.com/loonghao/photoshop-python-api
@wayix Time mainly, I've started the investigation process but haven't got much further than that since I'm lacking the time currently to dedicate myself to such a big problem. If you have the time and capacity I would appreciate help with the implementation, the resources linked above are a good starting point. Keep in mind that this is a rather big undertaking which can also be split into components such as first adding basic read support and then expanding that