You are here

Extract Text From Text Layers

Hello everyone,

I am trying to extract text from various text layers in a bunch of .xcf files. May I know if someone has developed scripts to realize this before? Please advise and thank you very much.


to still be editable in Gimp?
If so you must save the layer as an xcf format.

Hello wacmaster,

I actually would like to extract text from the text layer and put them in a word doc. My purpose is to spell check those text. Do you have any idea about this?

Thanks a lot.

Can you not just copy the text from the text box and paste it in your editor?

there are too many text layers in each xcf, and there are hundreds of xcf...

I opened an xcf file in a text editor and the text is clear (along with lots of binary data)

I created an image with text layers in it. The text is stored like this: (text "This is\ntext")

This grep worked for me but may break depending on the text in your text layers:
grep -aPo '^.*?\K(?<=\(text \").*?(?=\"\))' text.xcf

-Rob A>

I've created a script to extract the text from the text layers:

It creates two entries on the menu at
contrib/Extract Text - For a single file
contrib/Batch Extract Text - For all the files

i m also looking for it.

Subscribe to Comments for "Extract Text From Text Layers"