Hi. First time post, and gimp
python newbie here, so apologies if this is obvious. I'm trying to emulate what I can do in the UI:
1. Create a new image, say 1000px wide, 500px high, transparent fill.
2. Open as layers "file1.png", which is 800px wide, 500px high - this leaves 100px of transparecy either side of the layer, which is what I want
3. Export as "file2.png" - gives me a 1000px by 500px PNG, with the 800px image in the middle, and 100px transparency on either side - perfect.
Here's what I have:
img=pdb.gimp_image_new(1000, 500, 0)
lyr=pdb.gimp_file_load_layer(img,'C:\temp/file1.png')
pdb.gimp_image_insert_layer(img, lyr, None, 0)
# here's where I'm lost... how do I save as png with the transparent border? The following saves just as 800px wide, and loses the 100px transparency on either side...
drw=pdb.gimp_image_active_drawable(img)
pdb.file_png_save2(img,drw,'C:\temp/file2.png', 'C:\temp/file2.png',0,9,0,0,0,1,1,1,1)
Any help gratefully received!