Post Reply 

PDB call to Image/Canvas size... ?

Aug 29, 2014, 14:44
Post: #1
PDB call to Image/Canvas size... ?
Hi,

I am writing a Python script meant to take two separate images, apply some scaling and then put them side-by-size on a defined-size canvas. I am a nice way along except that now I am struggling to find a way to adjust canvas size from within that script.

The way I though to go about this is more or less the operation I used to do manually; with both files open, change the canvas of of file LEFT to double the size and then paste on the right-hand side file RIGHT. I am now stuck at increasing LEFT image's canvas - I simply cannot find the PDB call for it.

Can someone help, or guide me on a better method to go about this? I am new at GIMP/Python scripting so any detail is appreciated!

Thanks!
Find all posts by this user
Quote this message in a reply
Aug 29, 2014, 22:36
Post: #2
RE: PDB call to Image/Canvas size... ?
Hi,

Try pdb.gimp_image_resize(image, Width, Height, OffsetX, OffsetY)
Find all posts by this user
Quote this message in a reply
Aug 30, 2014, 00:47
Post: #3
RE: PDB call to Image/Canvas size... ?
This is effectively what I was looking for. I was trying all sorts of searches in the Procedure Browser with the keyword 'canvas,' which got me nowhere.

Thanks!
Find all posts by this user
Quote this message in a reply
Sep 1, 2014, 22:31
Post: #4
RE: PDB call to Image/Canvas size... ?
Right, but you'll note that gimp_image_resize is not a perfect equivalent of 'Canvas Size...'.

In a script, to mimic the menu item behaviour, a second call is necessary (gimp_layer_resize).
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dividing and printing a large image RayArdia 1 55 Aug 9, 2017 07:22
Last Post: ythgilb
  Late binding / COM for opening an image into GIMP? i73 2 62 Aug 4, 2017 17:39
Last Post: i73
  G'MIC Image Sequence AdrParkinson 7 459 Aug 10, 2014 08:12
Last Post: AdrParkinson
  Get current image with script-fu? puggsoy 15 3,948 Jun 15, 2014 23:37
Last Post: puggsoy
  Image Stacking ybur 16 3,708 May 22, 2014 18:13
Last Post: ybur

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS