Mon Apr 10, 2017 8:15 pm
image = pdb.gimp_xcf_load(dummy_param, filename, raw_filename) /
pdb.gimp_text_layer_set_text(layer, text) /
pdb.file_png_save(image, drawable, filename, raw_filename, interlace, compression, bkgd, gama, offs, phys, time) /
image = pdb.gimp_xcf_load(0, "C:\E\D\C\B\A.xcf", "C:\E\D\C\B\A.xcf")
pdb.gimp_text_layer_set_text("TextLayer", "Hello_World")
pdb.file_png_save(1Picture.png, 1Picture.png, HelloWorld, HelloWorld, No, 9, No, No, No, No, Yes)
image = pdb.gimp_xcf_load(0, "C:\E\D\C\B\A.xcf", "C:\E\D\C\B\A.xcf")
>>> pdb.gimp_text_layer_set_text("TextLayer", "Hello_World")
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: wrong parameter type
>>> pdb.file_png_save(1Picture.png, 1Picture.png, HelloWorld, HelloWorld, No, 9, No, No, No, No, Yes)
Tue Apr 11, 2017 2:12 am
Tue Apr 11, 2017 12:47 pm
>>> image = pdb.gimp_xcf_load(dummy_param, filename, raw_filename)
>>> layer = pdb.gimp_text_layer_new(image, text, fontname, size, unit)
>>> pdb.gimp_image_insert_layer(image, layer, parent, position)
>>> pdb.gimp_text_layer_set_text(layer, text)
>>> layer = pdb.gimp_layer_new_from_visible(image, dest_image, name)
>>> pdb.file_png_save_defaults(image, drawable, filename, raw_filename)
image = pdb.gimp_xcf_load(0, "C:\\E\\D\\C\\B\\A.xcf", "A.xcf")
layer = pdb.gimp_text_layer_new(“A”, “TextLayer”, “Arial”, 64, 1)
pdb.gimp_image_insert_layer(“A”, “TextLayer”, “Background”, (640, 640))
pdb.gimp_text_layer_set_text("TextLayer", "Hello_World")
layer = pdb.gimp_layer_new_from_visible("A", "A", "B")
pdb.file_png_save_defaults("A", "B", "C:\\J\\K\\F\\O”, “O”)
>>> image = pdb.gimp_xcf_load(0, "C:\\E\\D\\C\\B\\A.xcf", "A.xcf")
Traceback (most recent call last):
File "<input>", line 1, in <module>
RuntimeError: Could not open 'C:\\E\\D\\C\\B\\A.xcf' for reading: No such file or directory
>>> layer = pdb.gimp_text_layer_new(“A”, “TextLayer”, “Arial”, 64, 1)
File "<input>", line 1
layer = pdb.gimp_text_layer_new(“A”, “TextLayer”, “Arial”, 64, 1)
^
SyntaxError: invalid syntax
>>> pdb.gimp_image_insert_layer(“A”, “TextLayer”, “Background”, (640, 640))
File "<input>", line 1
pdb.gimp_image_insert_layer(“A”, “TextLayer”, “Background”, (640, 640))
^
SyntaxError: invalid syntax
>>> pdb.gimp_text_layer_set_text("TextLayer", "Hello_World")
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: wrong parameter type
>>> layer = pdb.gimp_layer_new_from_visible("A", "A", "B")
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: wrong parameter type
>>> pdb.file_png_save_defaults("A", "B", "C:\\J\\K\\F\\O”, “O”)
Tue Apr 11, 2017 5:15 pm
>>> [u for u in dir() if "UNIT_" in u]
['UNIT_INCH', 'UNIT_MM', 'UNIT_PICA', 'UNIT_PIXEL', 'UNIT_POINT']
Mon Apr 17, 2017 1:00 am
Mon Apr 17, 2017 2:14 am
Mon Apr 17, 2017 2:29 am
image = pdb.gimp_xcf_load(0, "C:\\E\\D\\C\\B\\A.xcf", "A.xcf")
layer = pdb.gimp_text_layer_new(image, “TextLayer”, “Arial”, 64, UNIT_PIXEL)
pdb.gimp_image_insert_layer(image, layer, None,0)
pdb.gimp_text_layer_set_text(layer, "Hello_World")
merged_layer = pdb.gimp_layer_new_from_visible(image,image, "New from visible")
pdb.file_png_save_defaults(image,merged_layer, "C:\\J\\K\\F\\O”, “O”)
Mon Apr 17, 2017 3:26 pm
image = pdb.gimp_xcf_load(0, "C:\\E\\D\\C\\B\\A.xcf", "A.xcf")
layer = pdb.gimp_text_layer_new(image, "TextLayer", "Arial", 64, UNIT_PIXEL)
pdb.gimp_image_insert_layer(image, layer, None,0)
pdb.gimp_text_layer_set_text(layer, "Hello_World")
merged_layer = pdb.gimp_layer_new_from_visible(image,image, "New from visible")
pdb.file_png_save_defaults(image,merged_layer, "C:\\J\\K\\F\\O.png", "O.png")
Mon Apr 17, 2017 6:43 pm
TRBear wrote:While the script can run successfully, it doesn't change the original .xcf picture at all.
TRBear wrote:I'll try my best to explain what exactly I am trying to do with the use of pictures.
I want the "123" in Example1.png to become "Five" as seen in Example2.png
I had thought that I needed to use the "pdb.gimp_text_layer_set_text" line, but it seems that it needs to be defined using the "layer = pdb.gimp_text_layer_new" line. If there is any way to do what I am trying to do, please let me know.
Sun Apr 30, 2017 12:10 am
Sun Apr 30, 2017 4:40 am
TRBear wrote: Also, could you tell me what you mean by saving the image? I could not find any script on the Python Procedure Browser that would do that, so if you could provide me with what you have in mind, that would be appreciated.