[gimp/wip/Jehan/classy-GIMP: 1/30] app, pdb, libgimp: add a new GimpImage class for plug-ins.



commit 2abd1452e3f3faa58b045193bc7fbeb02ea9e30b
Author: Jehan <jehan girinstud io>
Date:   Sun Aug 11 14:20:05 2019 +0200

    app, pdb, libgimp: add a new GimpImage class for plug-ins.
    
    This means that all functions which were returning or taking as
    parameter an image id (as gint32) are now taking a GimpImage object
    instead.
    The PDB is still passing around an id only over the wire. But we create
    an object for plug-ins to work on.
    
    This is quite a huge API break, but is probably the best bet for the
    future quality. It will make nicer API instrospection (and nicer API in
    binding), will fix the issues with pspec on GimpImageID in Python
    bindings (which makes the current Python API unusable as soon as we need
    to work on images, which is most of our plug-ins!), etc.
    Also it will allow to use signals on images, which will be a great asset
    when we will finally have bi-directionnal communications (i.e. plug-ins
    would be able to connect to image changes, destructions, and whatnot).

 app/pdb/image-cmds.c                |   8 +-
 libgimp/gimp.def                    |   2 +
 libgimp/gimpchannel_pdb.c           |  12 +-
 libgimp/gimpchannel_pdb.h           |   4 +-
 libgimp/gimpdisplay_pdb.c           |  18 +-
 libgimp/gimpdisplay_pdb.h           |  12 +-
 libgimp/gimpedit_pdb.c              |  32 +-
 libgimp/gimpedit_pdb.h              |  32 +-
 libgimp/gimpfileops_pdb.c           |  34 +-
 libgimp/gimpfileops_pdb.h           |  10 +-
 libgimp/gimpimage.c                 | 109 +++++++
 libgimp/gimpimage.h                 |  37 +++
 libgimp/gimpimage_pdb.c             | 634 ++++++++++++++++++------------------
 libgimp/gimpimage_pdb.h             | 162 ++++-----
 libgimp/gimpimagecolorprofile_pdb.c |  40 +--
 libgimp/gimpimagecolorprofile_pdb.h |  12 +-
 libgimp/gimpimageconvert_pdb.c      |  26 +-
 libgimp/gimpimageconvert_pdb.h      |   8 +-
 libgimp/gimpimagegrid_pdb.c         |  82 ++---
 libgimp/gimpimagegrid_pdb.h         |  20 +-
 libgimp/gimpimageguides_pdb.c       |  48 +--
 libgimp/gimpimageguides_pdb.h       |  24 +-
 libgimp/gimpimagesamplepoints_pdb.c |  36 +-
 libgimp/gimpimagesamplepoints_pdb.h |  20 +-
 libgimp/gimpimageselect_pdb.c       |  88 ++---
 libgimp/gimpimageselect_pdb.h       |  14 +-
 libgimp/gimpimagetransform_pdb.c    |  60 ++--
 libgimp/gimpimagetransform_pdb.h    |  36 +-
 libgimp/gimpimageundo_pdb.c         |  42 +--
 libgimp/gimpimageundo_pdb.h         |  14 +-
 libgimp/gimpitem_pdb.c              |  10 +-
 libgimp/gimpitem_pdb.h              |   2 +-
 libgimp/gimplayer_pdb.c             |  32 +-
 libgimp/gimplayer_pdb.h             |  10 +-
 libgimp/gimpselection_pdb.c         | 110 +++----
 libgimp/gimpselection_pdb.h         |  60 ++--
 libgimp/gimptextlayer_pdb.c         |   6 +-
 libgimp/gimptextlayer_pdb.h         |   2 +-
 libgimp/gimptexttool_pdb.c          |   6 +-
 libgimp/gimptexttool_pdb.h          |   2 +-
 libgimp/gimptypes.h                 |   2 +
 libgimp/gimpvectors_pdb.c           |  40 +--
 libgimp/gimpvectors_pdb.h           |  12 +-
 pdb/groups/image.pdb                |   8 +-
 pdb/lib.pl                          |   3 +
 pdb/pdb.pl                          |   7 +-
 46 files changed, 1071 insertions(+), 917 deletions(-)
---
diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c
index 73fabe4875..804ec183c9 100644
--- a/app/pdb/image-cmds.c
+++ b/app/pdb/image-cmds.c
@@ -2772,7 +2772,7 @@ register_image_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-image-is-valid",
                                      "Returns TRUE if the image is valid.",
-                                     "This procedure checks if the given image ID is valid and refers to an 
existing image.",
+                                     "This procedure checks if the given image is valid and refers to an 
existing image.",
                                      "Sven Neumann <sven gimp org>",
                                      "Sven Neumann",
                                      "2007",
@@ -2786,7 +2786,7 @@ register_image_procs (GimpPDB *pdb)
   gimp_procedure_add_return_value (procedure,
                                    g_param_spec_boolean ("valid",
                                                          "valid",
-                                                         "Whether the image ID is valid",
+                                                         "Whether the image is valid",
                                                          FALSE,
                                                          GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -2858,7 +2858,7 @@ register_image_procs (GimpPDB *pdb)
   gimp_procedure_add_return_value (procedure,
                                    gimp_param_spec_image_id ("image",
                                                              "image",
-                                                             "The ID of the newly created image",
+                                                             "The newly created image",
                                                              pdb->gimp, FALSE,
                                                              GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
@@ -2907,7 +2907,7 @@ register_image_procs (GimpPDB *pdb)
   gimp_procedure_add_return_value (procedure,
                                    gimp_param_spec_image_id ("image",
                                                              "image",
-                                                             "The ID of the newly created image",
+                                                             "The newly created image",
                                                              pdb->gimp, FALSE,
                                                              GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 2037a031f9..da58b5cdf5 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -386,6 +386,7 @@ EXPORTS
        gimp_image_get_floating_sel
        gimp_image_get_guide_orientation
        gimp_image_get_guide_position
+       gimp_image_get_id
        gimp_image_get_imported_uri
        gimp_image_get_item_position
        gimp_image_get_layer_by_name
@@ -402,6 +403,7 @@ EXPORTS
        gimp_image_get_tattoo_state
        gimp_image_get_thumbnail
        gimp_image_get_thumbnail_data
+       gimp_image_get_type
        gimp_image_get_unit
        gimp_image_get_uri
        gimp_image_get_vectors
diff --git a/libgimp/gimpchannel_pdb.c b/libgimp/gimpchannel_pdb.c
index 8022d0c5f0..e955c55ccd 100644
--- a/libgimp/gimpchannel_pdb.c
+++ b/libgimp/gimpchannel_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * _gimp_channel_new:
- * @image_ID: The image to which to add the channel.
+ * @image: The image to which to add the channel.
  * @width: The channel width.
  * @height: The channel height.
  * @name: The channel name.
@@ -56,7 +56,7 @@
  * Returns: The newly created channel.
  **/
 gint32
-_gimp_channel_new (gint32         image_ID,
+_gimp_channel_new (GimpImage     *image,
                    gint           width,
                    gint           height,
                    const gchar   *name,
@@ -69,7 +69,7 @@ _gimp_channel_new (gint32         image_ID,
   gint32 channel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, width,
                                           GIMP_TYPE_INT32, height,
                                           G_TYPE_STRING, name,
@@ -96,7 +96,7 @@ _gimp_channel_new (gint32         image_ID,
 
 /**
  * gimp_channel_new_from_component:
- * @image_ID: The image to which to add the channel.
+ * @image: The image to which to add the channel.
  * @component: The image component.
  * @name: The channel name.
  *
@@ -113,7 +113,7 @@ _gimp_channel_new (gint32         image_ID,
  * Since: 2.4
  **/
 gint32
-gimp_channel_new_from_component (gint32           image_ID,
+gimp_channel_new_from_component (GimpImage       *image,
                                  GimpChannelType  component,
                                  const gchar     *name)
 {
@@ -123,7 +123,7 @@ gimp_channel_new_from_component (gint32           image_ID,
   gint32 channel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_TYPE, component,
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
diff --git a/libgimp/gimpchannel_pdb.h b/libgimp/gimpchannel_pdb.h
index 84fa4af120..4e1cb8318a 100644
--- a/libgimp/gimpchannel_pdb.h
+++ b/libgimp/gimpchannel_pdb.h
@@ -32,13 +32,13 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-G_GNUC_INTERNAL gint32 _gimp_channel_new               (gint32           image_ID,
+G_GNUC_INTERNAL gint32 _gimp_channel_new               (GimpImage       *image,
                                                         gint             width,
                                                         gint             height,
                                                         const gchar     *name,
                                                         gdouble          opacity,
                                                         const GimpRGB   *color);
-gint32                 gimp_channel_new_from_component (gint32           image_ID,
+gint32                 gimp_channel_new_from_component (GimpImage       *image,
                                                         GimpChannelType  component,
                                                         const gchar     *name);
 gint32                 gimp_channel_copy               (gint32           channel_ID);
diff --git a/libgimp/gimpdisplay_pdb.c b/libgimp/gimpdisplay_pdb.c
index 51469bc33c..f89655fead 100644
--- a/libgimp/gimpdisplay_pdb.c
+++ b/libgimp/gimpdisplay_pdb.c
@@ -78,7 +78,7 @@ gimp_display_is_valid (gint32 display_ID)
 
 /**
  * gimp_display_new:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Create a new display for the specified image.
  *
@@ -92,7 +92,7 @@ gimp_display_is_valid (gint32 display_ID)
  * Returns: The new display.
  **/
 gint32
-gimp_display_new (gint32 image_ID)
+gimp_display_new (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -100,7 +100,7 @@ gimp_display_new (gint32 image_ID)
   gint32 display_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -248,8 +248,8 @@ gimp_displays_flush (void)
 
 /**
  * gimp_displays_reconnect:
- * @old_image_ID: The old image (must have at least one display).
- * @new_image_ID: The new image (must not have a display).
+ * @old_image: The old image (must have at least one display).
+ * @new_image: The new image (must not have a display).
  *
  * Reconnect displays from one image to another image.
  *
@@ -261,8 +261,8 @@ gimp_displays_flush (void)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_displays_reconnect (gint32 old_image_ID,
-                         gint32 new_image_ID)
+gimp_displays_reconnect (GimpImage *old_image,
+                         GimpImage *new_image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -270,8 +270,8 @@ gimp_displays_reconnect (gint32 old_image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, old_image_ID,
-                                          GIMP_TYPE_IMAGE_ID, new_image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (old_image),
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (new_image),
                                           G_TYPE_NONE);
 
   if (pdb)
diff --git a/libgimp/gimpdisplay_pdb.h b/libgimp/gimpdisplay_pdb.h
index b9cdeb9572..94a1c00e1d 100644
--- a/libgimp/gimpdisplay_pdb.h
+++ b/libgimp/gimpdisplay_pdb.h
@@ -32,13 +32,13 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_display_is_valid          (gint32 display_ID);
-gint32   gimp_display_new               (gint32 image_ID);
-gboolean gimp_display_delete            (gint32 display_ID);
-gint     gimp_display_get_window_handle (gint32 display_ID);
+gboolean gimp_display_is_valid          (gint32     display_ID);
+gint32   gimp_display_new               (GimpImage *image);
+gboolean gimp_display_delete            (gint32     display_ID);
+gint     gimp_display_get_window_handle (gint32     display_ID);
 gboolean gimp_displays_flush            (void);
-gboolean gimp_displays_reconnect        (gint32 old_image_ID,
-                                         gint32 new_image_ID);
+gboolean gimp_displays_reconnect        (GimpImage *old_image,
+                                         GimpImage *new_image);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpedit_pdb.c b/libgimp/gimpedit_pdb.c
index 3b33d07a4e..a7bf1f89ab 100644
--- a/libgimp/gimpedit_pdb.c
+++ b/libgimp/gimpedit_pdb.c
@@ -128,7 +128,7 @@ gimp_edit_copy (gint32 drawable_ID)
 
 /**
  * gimp_edit_copy_visible:
- * @image_ID: The image to copy from.
+ * @image: The image to copy from.
  *
  * Copy from the projection.
  *
@@ -144,7 +144,7 @@ gimp_edit_copy (gint32 drawable_ID)
  * Since: 2.2
  **/
 gboolean
-gimp_edit_copy_visible (gint32 image_ID)
+gimp_edit_copy_visible (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -152,7 +152,7 @@ gimp_edit_copy_visible (gint32 image_ID)
   gboolean non_empty = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -238,17 +238,17 @@ gimp_edit_paste (gint32   drawable_ID,
  * previously made to either gimp_edit_cut() or gimp_edit_copy(). This
  * procedure returns the new image or -1 if the edit buffer was empty.
  *
- * Returns: The new image.
+ * Returns: (transfer full): The new image.
  *
  * Since: 2.10
  **/
-gint32
+GimpImage *
 gimp_edit_paste_as_new_image (void)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 image_ID = -1;
+  GimpImage *image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
                                           G_TYPE_NONE);
@@ -263,11 +263,11 @@ gimp_edit_paste_as_new_image (void)
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return image_ID;
+  return image;
 }
 
 /**
@@ -370,7 +370,7 @@ gimp_edit_named_copy (gint32       drawable_ID,
 
 /**
  * gimp_edit_named_copy_visible:
- * @image_ID: The image to copy from.
+ * @image: The image to copy from.
  * @buffer_name: The name of the buffer to create.
  *
  * Copy from the projection into a named buffer.
@@ -387,7 +387,7 @@ gimp_edit_named_copy (gint32       drawable_ID,
  * Since: 2.4
  **/
 gchar *
-gimp_edit_named_copy_visible (gint32       image_ID,
+gimp_edit_named_copy_visible (GimpImage   *image,
                               const gchar *buffer_name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -396,7 +396,7 @@ gimp_edit_named_copy_visible (gint32       image_ID,
   gchar *real_name = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, buffer_name,
                                           G_TYPE_NONE);
 
@@ -474,17 +474,17 @@ gimp_edit_named_paste (gint32       drawable_ID,
  * This procedure works like gimp_edit_paste_as_new_image() but pastes
  * a named buffer instead of the global buffer.
  *
- * Returns: The new image.
+ * Returns: (transfer full): The new image.
  *
  * Since: 2.10
  **/
-gint32
+GimpImage *
 gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 image_ID = -1;
+  GimpImage *image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
                                           G_TYPE_STRING, buffer_name,
@@ -500,9 +500,9 @@ gimp_edit_named_paste_as_new_image (const gchar *buffer_name)
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return image_ID;
+  return image;
 }
diff --git a/libgimp/gimpedit_pdb.h b/libgimp/gimpedit_pdb.h
index 4e8c68e322..4092904f90 100644
--- a/libgimp/gimpedit_pdb.h
+++ b/libgimp/gimpedit_pdb.h
@@ -32,22 +32,22 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_edit_cut                      (gint32       drawable_ID);
-gboolean gimp_edit_copy                     (gint32       drawable_ID);
-gboolean gimp_edit_copy_visible             (gint32       image_ID);
-gint32   gimp_edit_paste                    (gint32       drawable_ID,
-                                             gboolean     paste_into);
-gint32   gimp_edit_paste_as_new_image       (void);
-gchar*   gimp_edit_named_cut                (gint32       drawable_ID,
-                                             const gchar *buffer_name);
-gchar*   gimp_edit_named_copy               (gint32       drawable_ID,
-                                             const gchar *buffer_name);
-gchar*   gimp_edit_named_copy_visible       (gint32       image_ID,
-                                             const gchar *buffer_name);
-gint32   gimp_edit_named_paste              (gint32       drawable_ID,
-                                             const gchar *buffer_name,
-                                             gboolean     paste_into);
-gint32   gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
+gboolean   gimp_edit_cut                      (gint32       drawable_ID);
+gboolean   gimp_edit_copy                     (gint32       drawable_ID);
+gboolean   gimp_edit_copy_visible             (GimpImage   *image);
+gint32     gimp_edit_paste                    (gint32       drawable_ID,
+                                               gboolean     paste_into);
+GimpImage* gimp_edit_paste_as_new_image       (void);
+gchar*     gimp_edit_named_cut                (gint32       drawable_ID,
+                                               const gchar *buffer_name);
+gchar*     gimp_edit_named_copy               (gint32       drawable_ID,
+                                               const gchar *buffer_name);
+gchar*     gimp_edit_named_copy_visible       (GimpImage   *image,
+                                               const gchar *buffer_name);
+gint32     gimp_edit_named_paste              (gint32       drawable_ID,
+                                               const gchar *buffer_name,
+                                               gboolean     paste_into);
+GimpImage* gimp_edit_named_paste_as_new_image (const gchar *buffer_name);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpfileops_pdb.c b/libgimp/gimpfileops_pdb.c
index dcd7affb3c..e0a8d645e6 100644
--- a/libgimp/gimpfileops_pdb.c
+++ b/libgimp/gimpfileops_pdb.c
@@ -50,9 +50,9 @@
  * https://www.gimp.org/foo.png he wants to fetch a URL, and the full
  * pathname will not look like a URL.
  *
- * Returns: The output image.
+ * Returns: (transfer full): The output image.
  **/
-gint32
+GimpImage *
 gimp_file_load (GimpRunMode  run_mode,
                 const gchar *filename,
                 const gchar *raw_filename)
@@ -60,7 +60,7 @@ gimp_file_load (GimpRunMode  run_mode,
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 image_ID = -1;
+  GimpImage *image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_RUN_MODE, run_mode,
@@ -78,17 +78,17 @@ gimp_file_load (GimpRunMode  run_mode,
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return image_ID;
+  return image;
 }
 
 /**
  * gimp_file_load_layer:
  * @run_mode: The run mode.
- * @image_ID: Destination image.
+ * @image: Destination image.
  * @filename: The name of the file to load.
  *
  * Loads an image file as a layer for an existing image.
@@ -104,7 +104,7 @@ gimp_file_load (GimpRunMode  run_mode,
  **/
 gint32
 gimp_file_load_layer (GimpRunMode  run_mode,
-                      gint32       image_ID,
+                      GimpImage   *image,
                       const gchar *filename)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -114,7 +114,7 @@ gimp_file_load_layer (GimpRunMode  run_mode,
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_RUN_MODE, run_mode,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, filename,
                                           G_TYPE_NONE);
 
@@ -138,7 +138,7 @@ gimp_file_load_layer (GimpRunMode  run_mode,
 /**
  * gimp_file_load_layers:
  * @run_mode: The run mode.
- * @image_ID: Destination image.
+ * @image: Destination image.
  * @filename: The name of the file to load.
  * @num_layers: (out): The number of loaded layers.
  *
@@ -157,7 +157,7 @@ gimp_file_load_layer (GimpRunMode  run_mode,
  **/
 gint *
 gimp_file_load_layers (GimpRunMode  run_mode,
-                       gint32       image_ID,
+                       GimpImage   *image,
                        const gchar *filename,
                        gint        *num_layers)
 {
@@ -168,7 +168,7 @@ gimp_file_load_layers (GimpRunMode  run_mode,
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_RUN_MODE, run_mode,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, filename,
                                           G_TYPE_NONE);
 
@@ -197,7 +197,7 @@ gimp_file_load_layers (GimpRunMode  run_mode,
 /**
  * gimp_file_save:
  * @run_mode: The run mode.
- * @image_ID: Input image.
+ * @image: Input image.
  * @drawable_ID: Drawable to save.
  * @filename: The name of the file to save the image in.
  * @raw_filename: The name as entered by the user.
@@ -216,7 +216,7 @@ gimp_file_load_layers (GimpRunMode  run_mode,
  **/
 gboolean
 gimp_file_save (GimpRunMode  run_mode,
-                gint32       image_ID,
+                GimpImage   *image,
                 gint32       drawable_ID,
                 const gchar *filename,
                 const gchar *raw_filename)
@@ -228,7 +228,7 @@ gimp_file_save (GimpRunMode  run_mode,
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_RUN_MODE, run_mode,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_DRAWABLE_ID, drawable_ID,
                                           G_TYPE_STRING, filename,
                                           G_TYPE_STRING, raw_filename,
@@ -252,7 +252,7 @@ gimp_file_save (GimpRunMode  run_mode,
 
 /**
  * gimp_file_save_thumbnail:
- * @image_ID: The image.
+ * @image: The image.
  * @filename: The name of the file the thumbnail belongs to.
  *
  * Saves a thumbnail for the given image
@@ -267,7 +267,7 @@ gimp_file_save (GimpRunMode  run_mode,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_file_save_thumbnail (gint32       image_ID,
+gimp_file_save_thumbnail (GimpImage   *image,
                           const gchar *filename)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -276,7 +276,7 @@ gimp_file_save_thumbnail (gint32       image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, filename,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpfileops_pdb.h b/libgimp/gimpfileops_pdb.h
index 572f5c2ded..d05527c482 100644
--- a/libgimp/gimpfileops_pdb.h
+++ b/libgimp/gimpfileops_pdb.h
@@ -32,22 +32,22 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gint32                   gimp_file_load                       (GimpRunMode  run_mode,
+GimpImage*               gimp_file_load                       (GimpRunMode  run_mode,
                                                                const gchar *filename,
                                                                const gchar *raw_filename);
 gint32                   gimp_file_load_layer                 (GimpRunMode  run_mode,
-                                                               gint32       image_ID,
+                                                               GimpImage   *image,
                                                                const gchar *filename);
 gint*                    gimp_file_load_layers                (GimpRunMode  run_mode,
-                                                               gint32       image_ID,
+                                                               GimpImage   *image,
                                                                const gchar *filename,
                                                                gint        *num_layers);
 gboolean                 gimp_file_save                       (GimpRunMode  run_mode,
-                                                               gint32       image_ID,
+                                                               GimpImage   *image,
                                                                gint32       drawable_ID,
                                                                const gchar *filename,
                                                                const gchar *raw_filename);
-gboolean                 gimp_file_save_thumbnail             (gint32       image_ID,
+gboolean                 gimp_file_save_thumbnail             (GimpImage   *image,
                                                                const gchar *filename);
 G_GNUC_INTERNAL gboolean _gimp_register_magic_load_handler    (const gchar *procedure_name,
                                                                const gchar *extensions,
diff --git a/libgimp/gimpimage.c b/libgimp/gimpimage.c
index 44f00b44fe..3fab338af2 100644
--- a/libgimp/gimpimage.c
+++ b/libgimp/gimpimage.c
@@ -24,6 +24,115 @@
 
 #include "gimppixbuf.h"
 
+enum
+{
+  PROP_0,
+  PROP_ID,
+  N_PROPS
+};
+
+struct _GimpImagePrivate
+{
+  gint32 id;
+};
+
+static void       gimp_image_set_property  (GObject      *object,
+                                            guint         property_id,
+                                            const GValue *value,
+                                            GParamSpec   *pspec);
+static void       gimp_image_get_property  (GObject      *object,
+                                            guint         property_id,
+                                            GValue       *value,
+                                            GParamSpec   *pspec);
+
+G_DEFINE_TYPE_WITH_PRIVATE (GimpImage, gimp_image, G_TYPE_OBJECT)
+
+#define parent_class gimp_image_parent_class
+
+static GParamSpec *props[N_PROPS] = { NULL, };
+
+static void
+gimp_image_class_init (GimpImageClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->set_property = gimp_image_set_property;
+  object_class->get_property = gimp_image_get_property;
+
+  props[PROP_ID] =
+    gimp_param_spec_int32 ("id",
+                           "The image id",
+                           "The image id for internal use",
+                           0, G_MAXINT32, 0,
+                           GIMP_PARAM_READWRITE |
+                           G_PARAM_CONSTRUCT_ONLY);
+
+  g_object_class_install_properties (object_class, N_PROPS, props);
+}
+
+static void
+gimp_image_init (GimpImage *image)
+{
+  image->priv = gimp_image_get_instance_private (image);
+}
+
+static void
+gimp_image_set_property (GObject      *object,
+                         guint         property_id,
+                         const GValue *value,
+                         GParamSpec   *pspec)
+{
+  GimpImage *image = GIMP_IMAGE (object);
+
+  switch (property_id)
+    {
+    case PROP_ID:
+      image->priv->id = g_value_get_int (value);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+      break;
+    }
+}
+
+static void
+gimp_image_get_property (GObject    *object,
+                         guint       property_id,
+                         GValue     *value,
+                         GParamSpec *pspec)
+{
+  GimpImage *image = GIMP_IMAGE (object);
+
+  switch (property_id)
+    {
+    case PROP_ID:
+      g_value_set_int (value, image->priv->id);
+      break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+      break;
+    }
+}
+
+
+/* Public API. */
+
+
+/**
+ * gimp_image_get_id:
+ * @image: The image.
+ *
+ * Returns: the image ID.
+ *
+ * Since: 3.0
+ **/
+gint32
+gimp_image_get_id (GimpImage *image)
+{
+  return image->priv->id;
+}
 
 /**
  * gimp_image_get_colormap:
diff --git a/libgimp/gimpimage.h b/libgimp/gimpimage.h
index c71ebddfa7..468cc7bc39 100644
--- a/libgimp/gimpimage.h
+++ b/libgimp/gimpimage.h
@@ -29,6 +29,43 @@ G_BEGIN_DECLS
 
 /* For information look into the C source or the html documentation */
 
+#define GIMP_TYPE_IMAGE            (gimp_image_get_type ())
+#define GIMP_IMAGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_IMAGE, GimpImage))
+#define GIMP_IMAGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_IMAGE, GimpImageClass))
+#define GIMP_IS_IMAGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_IMAGE))
+#define GIMP_IS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_IMAGE))
+#define GIMP_IMAGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE, GimpImageClass))
+
+
+typedef struct _GimpImageClass   GimpImageClass;
+typedef struct _GimpImagePrivate GimpImagePrivate;
+
+struct _GimpImage
+{
+  GObject           parent_instance;
+
+  GimpImagePrivate *priv;
+};
+
+struct _GimpImageClass
+{
+  GObjectClass parent_class;
+
+  /* Padding for future expansion */
+  void (*_gimp_reserved1) (void);
+  void (*_gimp_reserved2) (void);
+  void (*_gimp_reserved3) (void);
+  void (*_gimp_reserved4) (void);
+  void (*_gimp_reserved5) (void);
+  void (*_gimp_reserved6) (void);
+  void (*_gimp_reserved7) (void);
+  void (*_gimp_reserved8) (void);
+  void (*_gimp_reserved9) (void);
+};
+
+GType          gimp_image_get_type           (void) G_GNUC_CONST;
+
+gint32         gimp_image_get_id             (GimpImage    *image);
 
 guchar       * gimp_image_get_colormap       (gint32        image_ID,
                                               gint         *num_colors);
diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c
index 4a81f6817d..749b48dd23 100644
--- a/libgimp/gimpimage_pdb.c
+++ b/libgimp/gimpimage_pdb.c
@@ -37,19 +37,19 @@
 
 /**
  * gimp_image_is_valid:
- * @image_ID: The image to check.
+ * @image: The image to check.
  *
  * Returns TRUE if the image is valid.
  *
- * This procedure checks if the given image ID is valid and refers to
- * an existing image.
+ * This procedure checks if the given image is valid and refers to an
+ * existing image.
  *
- * Returns: Whether the image ID is valid.
+ * Returns: Whether the image is valid.
  *
  * Since: 2.4
  **/
 gboolean
-gimp_image_is_valid (gint32 image_ID)
+gimp_image_is_valid (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -57,7 +57,7 @@ gimp_image_is_valid (gint32 image_ID)
   gboolean valid = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -141,9 +141,9 @@ gimp_image_list (gint *num_images)
  * gimp_image_set_colormap(). An indexed image without a colormap will
  * output unexpected colors.
  *
- * Returns: The ID of the newly created image.
+ * Returns: (transfer full): The newly created image.
  **/
-gint32
+GimpImage *
 gimp_image_new (gint              width,
                 gint              height,
                 GimpImageBaseType type)
@@ -151,7 +151,7 @@ gimp_image_new (gint              width,
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 image_ID = -1;
+  GimpImage *image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_INT32, width,
@@ -169,11 +169,11 @@ gimp_image_new (gint              width,
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return image_ID;
+  return image;
 }
 
 /**
@@ -191,11 +191,11 @@ gimp_image_new (gint              width,
  * GIMP_PRECISION_U8_NON_LINEAR precision. See gimp_image_new() for
  * further details.
  *
- * Returns: The ID of the newly created image.
+ * Returns: (transfer full): The newly created image.
  *
  * Since: 2.10
  **/
-gint32
+GimpImage *
 gimp_image_new_with_precision (gint              width,
                                gint              height,
                                GimpImageBaseType type,
@@ -204,7 +204,7 @@ gimp_image_new_with_precision (gint              width,
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 image_ID = -1;
+  GimpImage *image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_INT32, width,
@@ -223,34 +223,34 @@ gimp_image_new_with_precision (gint              width,
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return image_ID;
+  return image;
 }
 
 /**
  * gimp_image_duplicate:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Duplicate the specified image
  *
  * This procedure duplicates the specified image, copying all layers,
  * channels, and image information.
  *
- * Returns: The new, duplicated image.
+ * Returns: (transfer full): The new, duplicated image.
  **/
-gint32
-gimp_image_duplicate (gint32 image_ID)
+GimpImage *
+gimp_image_duplicate (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 new_image_ID = -1;
+  GimpImage *new_image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -263,16 +263,16 @@ gimp_image_duplicate (gint32 image_ID)
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    new_image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    new_image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return new_image_ID;
+  return new_image;
 }
 
 /**
  * gimp_image_delete:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Delete the specified image.
  *
@@ -286,7 +286,7 @@ gimp_image_duplicate (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_delete (gint32 image_ID)
+gimp_image_delete (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -294,7 +294,7 @@ gimp_image_delete (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -315,7 +315,7 @@ gimp_image_delete (gint32 image_ID)
 
 /**
  * gimp_image_base_type:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Get the base type of the image.
  *
@@ -325,7 +325,7 @@ gimp_image_delete (gint32 image_ID)
  * Returns: The image's base type.
  **/
 GimpImageBaseType
-gimp_image_base_type (gint32 image_ID)
+gimp_image_base_type (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -333,7 +333,7 @@ gimp_image_base_type (gint32 image_ID)
   GimpImageBaseType base_type = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -355,7 +355,7 @@ gimp_image_base_type (gint32 image_ID)
 
 /**
  * gimp_image_get_precision:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Get the precision of the image.
  *
@@ -366,7 +366,7 @@ gimp_image_base_type (gint32 image_ID)
  * Since: 2.10
  **/
 GimpPrecision
-gimp_image_get_precision (gint32 image_ID)
+gimp_image_get_precision (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -374,7 +374,7 @@ gimp_image_get_precision (gint32 image_ID)
   GimpPrecision precision = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -396,7 +396,7 @@ gimp_image_get_precision (gint32 image_ID)
 
 /**
  * gimp_image_get_default_new_layer_mode:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Get the default mode for newly created layers of this image.
  *
@@ -407,7 +407,7 @@ gimp_image_get_precision (gint32 image_ID)
  * Since: 2.10
  **/
 GimpLayerMode
-gimp_image_get_default_new_layer_mode (gint32 image_ID)
+gimp_image_get_default_new_layer_mode (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -415,7 +415,7 @@ gimp_image_get_default_new_layer_mode (gint32 image_ID)
   GimpLayerMode mode = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -437,7 +437,7 @@ gimp_image_get_default_new_layer_mode (gint32 image_ID)
 
 /**
  * gimp_image_width:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Return the width of the image
  *
@@ -447,7 +447,7 @@ gimp_image_get_default_new_layer_mode (gint32 image_ID)
  * Returns: The image's width.
  **/
 gint
-gimp_image_width (gint32 image_ID)
+gimp_image_width (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -455,7 +455,7 @@ gimp_image_width (gint32 image_ID)
   gint width = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -477,7 +477,7 @@ gimp_image_width (gint32 image_ID)
 
 /**
  * gimp_image_height:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Return the height of the image
  *
@@ -487,7 +487,7 @@ gimp_image_width (gint32 image_ID)
  * Returns: The image's height.
  **/
 gint
-gimp_image_height (gint32 image_ID)
+gimp_image_height (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -495,7 +495,7 @@ gimp_image_height (gint32 image_ID)
   gint height = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -517,7 +517,7 @@ gimp_image_height (gint32 image_ID)
 
 /**
  * gimp_image_get_layers:
- * @image_ID: The image.
+ * @image: The image.
  * @num_layers: (out): The number of layers contained in the image.
  *
  * Returns the list of layers contained in the specified image.
@@ -530,8 +530,8 @@ gimp_image_height (gint32 image_ID)
  *          The returned value must be freed with g_free().
  **/
 gint *
-gimp_image_get_layers (gint32  image_ID,
-                       gint   *num_layers)
+gimp_image_get_layers (GimpImage *image,
+                       gint      *num_layers)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -539,7 +539,7 @@ gimp_image_get_layers (gint32  image_ID,
   gint *layer_ids = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -566,7 +566,7 @@ gimp_image_get_layers (gint32  image_ID,
 
 /**
  * gimp_image_get_channels:
- * @image_ID: The image.
+ * @image: The image.
  * @num_channels: (out): The number of channels contained in the image.
  *
  * Returns the list of channels contained in the specified image.
@@ -582,8 +582,8 @@ gimp_image_get_layers (gint32  image_ID,
  *          The returned value must be freed with g_free().
  **/
 gint *
-gimp_image_get_channels (gint32  image_ID,
-                         gint   *num_channels)
+gimp_image_get_channels (GimpImage *image,
+                         gint      *num_channels)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -591,7 +591,7 @@ gimp_image_get_channels (gint32  image_ID,
   gint *channel_ids = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -618,7 +618,7 @@ gimp_image_get_channels (gint32  image_ID,
 
 /**
  * gimp_image_get_vectors:
- * @image_ID: The image.
+ * @image: The image.
  * @num_vectors: (out): The number of vectors contained in the image.
  *
  * Returns the list of vectors contained in the specified image.
@@ -633,8 +633,8 @@ gimp_image_get_channels (gint32  image_ID,
  * Since: 2.4
  **/
 gint *
-gimp_image_get_vectors (gint32  image_ID,
-                        gint   *num_vectors)
+gimp_image_get_vectors (GimpImage *image,
+                        gint      *num_vectors)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -642,7 +642,7 @@ gimp_image_get_vectors (gint32  image_ID,
   gint *vector_ids = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -669,7 +669,7 @@ gimp_image_get_vectors (gint32  image_ID,
 
 /**
  * gimp_image_get_active_drawable:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Get the image's active drawable
  *
@@ -683,7 +683,7 @@ gimp_image_get_vectors (gint32  image_ID,
  * Returns: The active drawable.
  **/
 gint32
-gimp_image_get_active_drawable (gint32 image_ID)
+gimp_image_get_active_drawable (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -691,7 +691,7 @@ gimp_image_get_active_drawable (gint32 image_ID)
   gint32 drawable_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -713,7 +713,7 @@ gimp_image_get_active_drawable (gint32 image_ID)
 
 /**
  * gimp_image_unset_active_channel:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Unsets the active channel in the specified image.
  *
@@ -725,7 +725,7 @@ gimp_image_get_active_drawable (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_unset_active_channel (gint32 image_ID)
+gimp_image_unset_active_channel (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -733,7 +733,7 @@ gimp_image_unset_active_channel (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -754,7 +754,7 @@ gimp_image_unset_active_channel (gint32 image_ID)
 
 /**
  * gimp_image_get_floating_sel:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Return the floating selection of the image.
  *
@@ -764,7 +764,7 @@ gimp_image_unset_active_channel (gint32 image_ID)
  * Returns: The image's floating selection.
  **/
 gint32
-gimp_image_get_floating_sel (gint32 image_ID)
+gimp_image_get_floating_sel (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -772,7 +772,7 @@ gimp_image_get_floating_sel (gint32 image_ID)
   gint32 floating_sel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -794,7 +794,7 @@ gimp_image_get_floating_sel (gint32 image_ID)
 
 /**
  * gimp_image_floating_sel_attached_to:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Return the drawable the floating selection is attached to.
  *
@@ -805,7 +805,7 @@ gimp_image_get_floating_sel (gint32 image_ID)
  * Returns: The drawable the floating selection is attached to.
  **/
 gint32
-gimp_image_floating_sel_attached_to (gint32 image_ID)
+gimp_image_floating_sel_attached_to (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -813,7 +813,7 @@ gimp_image_floating_sel_attached_to (gint32 image_ID)
   gint32 drawable_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -835,7 +835,7 @@ gimp_image_floating_sel_attached_to (gint32 image_ID)
 
 /**
  * gimp_image_pick_color:
- * @image_ID: The image.
+ * @image: The image.
  * @drawable_ID: The drawable to pick from.
  * @x: x coordinate of upper-left corner of rectangle.
  * @y: y coordinate of upper-left corner of rectangle.
@@ -861,14 +861,14 @@ gimp_image_floating_sel_attached_to (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_pick_color (gint32    image_ID,
-                       gint32    drawable_ID,
-                       gdouble   x,
-                       gdouble   y,
-                       gboolean  sample_merged,
-                       gboolean  sample_average,
-                       gdouble   average_radius,
-                       GimpRGB  *color)
+gimp_image_pick_color (GimpImage *image,
+                       gint32     drawable_ID,
+                       gdouble    x,
+                       gdouble    y,
+                       gboolean   sample_merged,
+                       gboolean   sample_average,
+                       gdouble    average_radius,
+                       GimpRGB   *color)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -876,7 +876,7 @@ gimp_image_pick_color (gint32    image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_DRAWABLE_ID, drawable_ID,
                                           G_TYPE_DOUBLE, x,
                                           G_TYPE_DOUBLE, y,
@@ -906,7 +906,7 @@ gimp_image_pick_color (gint32    image_ID,
 
 /**
  * gimp_image_pick_correlate_layer:
- * @image_ID: The image.
+ * @image: The image.
  * @x: The x coordinate for the pick.
  * @y: The y coordinate for the pick.
  *
@@ -921,9 +921,9 @@ gimp_image_pick_color (gint32    image_ID,
  * Returns: The layer found at the specified coordinates.
  **/
 gint32
-gimp_image_pick_correlate_layer (gint32 image_ID,
-                                 gint   x,
-                                 gint   y)
+gimp_image_pick_correlate_layer (GimpImage *image,
+                                 gint       x,
+                                 gint       y)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -931,7 +931,7 @@ gimp_image_pick_correlate_layer (gint32 image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, x,
                                           GIMP_TYPE_INT32, y,
                                           G_TYPE_NONE);
@@ -955,7 +955,7 @@ gimp_image_pick_correlate_layer (gint32 image_ID,
 
 /**
  * gimp_image_insert_layer:
- * @image_ID: The image.
+ * @image: The image.
  * @layer_ID: The layer.
  * @parent_ID: The parent layer.
  * @position: The layer position.
@@ -977,10 +977,10 @@ gimp_image_pick_correlate_layer (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_insert_layer (gint32 image_ID,
-                         gint32 layer_ID,
-                         gint32 parent_ID,
-                         gint   position)
+gimp_image_insert_layer (GimpImage *image,
+                         gint32     layer_ID,
+                         gint32     parent_ID,
+                         gint       position)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -988,7 +988,7 @@ gimp_image_insert_layer (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_LAYER_ID, layer_ID,
                                           GIMP_TYPE_LAYER_ID, parent_ID,
                                           GIMP_TYPE_INT32, position,
@@ -1012,7 +1012,7 @@ gimp_image_insert_layer (gint32 image_ID,
 
 /**
  * gimp_image_remove_layer:
- * @image_ID: The image.
+ * @image: The image.
  * @layer_ID: The layer.
  *
  * Remove the specified layer from the image.
@@ -1026,8 +1026,8 @@ gimp_image_insert_layer (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_remove_layer (gint32 image_ID,
-                         gint32 layer_ID)
+gimp_image_remove_layer (GimpImage *image,
+                         gint32     layer_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1035,7 +1035,7 @@ gimp_image_remove_layer (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_LAYER_ID, layer_ID,
                                           G_TYPE_NONE);
 
@@ -1057,7 +1057,7 @@ gimp_image_remove_layer (gint32 image_ID,
 
 /**
  * gimp_image_freeze_layers:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Freeze the image's layer list.
  *
@@ -1074,7 +1074,7 @@ gimp_image_remove_layer (gint32 image_ID,
  * Since: 2.10.2
  **/
 gboolean
-gimp_image_freeze_layers (gint32 image_ID)
+gimp_image_freeze_layers (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1082,7 +1082,7 @@ gimp_image_freeze_layers (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1103,7 +1103,7 @@ gimp_image_freeze_layers (gint32 image_ID)
 
 /**
  * gimp_image_thaw_layers:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Thaw the image's layer list.
  *
@@ -1118,7 +1118,7 @@ gimp_image_freeze_layers (gint32 image_ID)
  * Since: 2.10.2
  **/
 gboolean
-gimp_image_thaw_layers (gint32 image_ID)
+gimp_image_thaw_layers (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1126,7 +1126,7 @@ gimp_image_thaw_layers (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1147,7 +1147,7 @@ gimp_image_thaw_layers (gint32 image_ID)
 
 /**
  * gimp_image_insert_channel:
- * @image_ID: The image.
+ * @image: The image.
  * @channel_ID: The channel.
  * @parent_ID: The parent channel.
  * @position: The channel position.
@@ -1164,10 +1164,10 @@ gimp_image_thaw_layers (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_insert_channel (gint32 image_ID,
-                           gint32 channel_ID,
-                           gint32 parent_ID,
-                           gint   position)
+gimp_image_insert_channel (GimpImage *image,
+                           gint32     channel_ID,
+                           gint32     parent_ID,
+                           gint       position)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1175,7 +1175,7 @@ gimp_image_insert_channel (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_ID, channel_ID,
                                           GIMP_TYPE_CHANNEL_ID, parent_ID,
                                           GIMP_TYPE_INT32, position,
@@ -1199,7 +1199,7 @@ gimp_image_insert_channel (gint32 image_ID,
 
 /**
  * gimp_image_remove_channel:
- * @image_ID: The image.
+ * @image: The image.
  * @channel_ID: The channel.
  *
  * Remove the specified channel from the image.
@@ -1210,8 +1210,8 @@ gimp_image_insert_channel (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_remove_channel (gint32 image_ID,
-                           gint32 channel_ID)
+gimp_image_remove_channel (GimpImage *image,
+                           gint32     channel_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1219,7 +1219,7 @@ gimp_image_remove_channel (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_ID, channel_ID,
                                           G_TYPE_NONE);
 
@@ -1241,7 +1241,7 @@ gimp_image_remove_channel (gint32 image_ID,
 
 /**
  * gimp_image_freeze_channels:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Freeze the image's channel list.
  *
@@ -1259,7 +1259,7 @@ gimp_image_remove_channel (gint32 image_ID,
  * Since: 2.10.2
  **/
 gboolean
-gimp_image_freeze_channels (gint32 image_ID)
+gimp_image_freeze_channels (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1267,7 +1267,7 @@ gimp_image_freeze_channels (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1288,7 +1288,7 @@ gimp_image_freeze_channels (gint32 image_ID)
 
 /**
  * gimp_image_thaw_channels:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Thaw the image's channel list.
  *
@@ -1303,7 +1303,7 @@ gimp_image_freeze_channels (gint32 image_ID)
  * Since: 2.10.2
  **/
 gboolean
-gimp_image_thaw_channels (gint32 image_ID)
+gimp_image_thaw_channels (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1311,7 +1311,7 @@ gimp_image_thaw_channels (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1332,7 +1332,7 @@ gimp_image_thaw_channels (gint32 image_ID)
 
 /**
  * gimp_image_insert_vectors:
- * @image_ID: The image.
+ * @image: The image.
  * @vectors_ID: The vectors.
  * @parent_ID: The parent vectors.
  * @position: The vectors position.
@@ -1349,10 +1349,10 @@ gimp_image_thaw_channels (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_insert_vectors (gint32 image_ID,
-                           gint32 vectors_ID,
-                           gint32 parent_ID,
-                           gint   position)
+gimp_image_insert_vectors (GimpImage *image,
+                           gint32     vectors_ID,
+                           gint32     parent_ID,
+                           gint       position)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1360,7 +1360,7 @@ gimp_image_insert_vectors (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_VECTORS_ID, vectors_ID,
                                           GIMP_TYPE_VECTORS_ID, parent_ID,
                                           GIMP_TYPE_INT32, position,
@@ -1384,7 +1384,7 @@ gimp_image_insert_vectors (gint32 image_ID,
 
 /**
  * gimp_image_remove_vectors:
- * @image_ID: The image.
+ * @image: The image.
  * @vectors_ID: The vectors object.
  *
  * Remove the specified path from the image.
@@ -1397,8 +1397,8 @@ gimp_image_insert_vectors (gint32 image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_remove_vectors (gint32 image_ID,
-                           gint32 vectors_ID)
+gimp_image_remove_vectors (GimpImage *image,
+                           gint32     vectors_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1406,7 +1406,7 @@ gimp_image_remove_vectors (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_VECTORS_ID, vectors_ID,
                                           G_TYPE_NONE);
 
@@ -1428,7 +1428,7 @@ gimp_image_remove_vectors (gint32 image_ID,
 
 /**
  * gimp_image_freeze_vectors:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Freeze the image's vectors list.
  *
@@ -1446,7 +1446,7 @@ gimp_image_remove_vectors (gint32 image_ID,
  * Since: 2.10.2
  **/
 gboolean
-gimp_image_freeze_vectors (gint32 image_ID)
+gimp_image_freeze_vectors (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1454,7 +1454,7 @@ gimp_image_freeze_vectors (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1475,7 +1475,7 @@ gimp_image_freeze_vectors (gint32 image_ID)
 
 /**
  * gimp_image_thaw_vectors:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Thaw the image's vectors list.
  *
@@ -1490,7 +1490,7 @@ gimp_image_freeze_vectors (gint32 image_ID)
  * Since: 2.10.2
  **/
 gboolean
-gimp_image_thaw_vectors (gint32 image_ID)
+gimp_image_thaw_vectors (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1498,7 +1498,7 @@ gimp_image_thaw_vectors (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1519,7 +1519,7 @@ gimp_image_thaw_vectors (gint32 image_ID)
 
 /**
  * gimp_image_get_item_position:
- * @image_ID: The image.
+ * @image: The image.
  * @item_ID: The item.
  *
  * Returns the position of the item in its level of its item tree.
@@ -1534,8 +1534,8 @@ gimp_image_thaw_vectors (gint32 image_ID)
  * Since: 2.8
  **/
 gint
-gimp_image_get_item_position (gint32 image_ID,
-                              gint32 item_ID)
+gimp_image_get_item_position (GimpImage *image,
+                              gint32     item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1543,7 +1543,7 @@ gimp_image_get_item_position (gint32 image_ID,
   gint position = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           G_TYPE_NONE);
 
@@ -1566,7 +1566,7 @@ gimp_image_get_item_position (gint32 image_ID,
 
 /**
  * gimp_image_raise_item:
- * @image_ID: The image.
+ * @image: The image.
  * @item_ID: The item to raise.
  *
  * Raise the specified item in its level in its item tree
@@ -1579,8 +1579,8 @@ gimp_image_get_item_position (gint32 image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_raise_item (gint32 image_ID,
-                       gint32 item_ID)
+gimp_image_raise_item (GimpImage *image,
+                       gint32     item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1588,7 +1588,7 @@ gimp_image_raise_item (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           G_TYPE_NONE);
 
@@ -1610,7 +1610,7 @@ gimp_image_raise_item (gint32 image_ID,
 
 /**
  * gimp_image_lower_item:
- * @image_ID: The image.
+ * @image: The image.
  * @item_ID: The item to lower.
  *
  * Lower the specified item in its level in its item tree
@@ -1623,8 +1623,8 @@ gimp_image_raise_item (gint32 image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_lower_item (gint32 image_ID,
-                       gint32 item_ID)
+gimp_image_lower_item (GimpImage *image,
+                       gint32     item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1632,7 +1632,7 @@ gimp_image_lower_item (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           G_TYPE_NONE);
 
@@ -1654,7 +1654,7 @@ gimp_image_lower_item (gint32 image_ID,
 
 /**
  * gimp_image_raise_item_to_top:
- * @image_ID: The image.
+ * @image: The image.
  * @item_ID: The item to raise to top.
  *
  * Raise the specified item to the top of its level in its item tree
@@ -1667,8 +1667,8 @@ gimp_image_lower_item (gint32 image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_raise_item_to_top (gint32 image_ID,
-                              gint32 item_ID)
+gimp_image_raise_item_to_top (GimpImage *image,
+                              gint32     item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1676,7 +1676,7 @@ gimp_image_raise_item_to_top (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           G_TYPE_NONE);
 
@@ -1698,7 +1698,7 @@ gimp_image_raise_item_to_top (gint32 image_ID,
 
 /**
  * gimp_image_lower_item_to_bottom:
- * @image_ID: The image.
+ * @image: The image.
  * @item_ID: The item to lower to bottom.
  *
  * Lower the specified item to the bottom of its level in its item tree
@@ -1712,8 +1712,8 @@ gimp_image_raise_item_to_top (gint32 image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_lower_item_to_bottom (gint32 image_ID,
-                                 gint32 item_ID)
+gimp_image_lower_item_to_bottom (GimpImage *image,
+                                 gint32     item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1721,7 +1721,7 @@ gimp_image_lower_item_to_bottom (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           G_TYPE_NONE);
 
@@ -1743,7 +1743,7 @@ gimp_image_lower_item_to_bottom (gint32 image_ID,
 
 /**
  * gimp_image_reorder_item:
- * @image_ID: The image.
+ * @image: The image.
  * @item_ID: The item to reorder.
  * @parent_ID: The new parent item.
  * @position: The new position of the item.
@@ -1757,10 +1757,10 @@ gimp_image_lower_item_to_bottom (gint32 image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_reorder_item (gint32 image_ID,
-                         gint32 item_ID,
-                         gint32 parent_ID,
-                         gint   position)
+gimp_image_reorder_item (GimpImage *image,
+                         gint32     item_ID,
+                         gint32     parent_ID,
+                         gint       position)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1768,7 +1768,7 @@ gimp_image_reorder_item (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           GIMP_TYPE_ITEM_ID, parent_ID,
                                           GIMP_TYPE_INT32, position,
@@ -1792,7 +1792,7 @@ gimp_image_reorder_item (gint32 image_ID,
 
 /**
  * gimp_image_flatten:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Flatten all visible layers into a single layer. Discard all
  * invisible layers.
@@ -1804,7 +1804,7 @@ gimp_image_reorder_item (gint32 image_ID,
  * Returns: The resulting layer.
  **/
 gint32
-gimp_image_flatten (gint32 image_ID)
+gimp_image_flatten (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1812,7 +1812,7 @@ gimp_image_flatten (gint32 image_ID)
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1834,7 +1834,7 @@ gimp_image_flatten (gint32 image_ID)
 
 /**
  * gimp_image_merge_visible_layers:
- * @image_ID: The image.
+ * @image: The image.
  * @merge_type: The type of merge.
  *
  * Merge the visible image layers into one.
@@ -1849,8 +1849,8 @@ gimp_image_flatten (gint32 image_ID)
  * Returns: The resulting layer.
  **/
 gint32
-gimp_image_merge_visible_layers (gint32        image_ID,
-                                 GimpMergeType merge_type)
+gimp_image_merge_visible_layers (GimpImage     *image,
+                                 GimpMergeType  merge_type)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1858,7 +1858,7 @@ gimp_image_merge_visible_layers (gint32        image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_MERGE_TYPE, merge_type,
                                           G_TYPE_NONE);
 
@@ -1881,7 +1881,7 @@ gimp_image_merge_visible_layers (gint32        image_ID,
 
 /**
  * gimp_image_merge_down:
- * @image_ID: The image.
+ * @image: The image.
  * @merge_layer_ID: The layer to merge down from.
  * @merge_type: The type of merge.
  *
@@ -1898,9 +1898,9 @@ gimp_image_merge_visible_layers (gint32        image_ID,
  * Returns: The resulting layer.
  **/
 gint32
-gimp_image_merge_down (gint32        image_ID,
-                       gint32        merge_layer_ID,
-                       GimpMergeType merge_type)
+gimp_image_merge_down (GimpImage     *image,
+                       gint32         merge_layer_ID,
+                       GimpMergeType  merge_type)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1908,7 +1908,7 @@ gimp_image_merge_down (gint32        image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_LAYER_ID, merge_layer_ID,
                                           GIMP_TYPE_MERGE_TYPE, merge_type,
                                           G_TYPE_NONE);
@@ -1932,7 +1932,7 @@ gimp_image_merge_down (gint32        image_ID,
 
 /**
  * _gimp_image_get_colormap:
- * @image_ID: The image.
+ * @image: The image.
  * @num_bytes: (out): Number of bytes in the colormap array.
  *
  * Returns the image's colormap
@@ -1948,8 +1948,8 @@ gimp_image_merge_down (gint32        image_ID,
  *          The returned value must be freed with g_free().
  **/
 guint8 *
-_gimp_image_get_colormap (gint32  image_ID,
-                          gint   *num_bytes)
+_gimp_image_get_colormap (GimpImage *image,
+                          gint      *num_bytes)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1957,7 +1957,7 @@ _gimp_image_get_colormap (gint32  image_ID,
   guint8 *colormap = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -1984,7 +1984,7 @@ _gimp_image_get_colormap (gint32  image_ID,
 
 /**
  * _gimp_image_set_colormap:
- * @image_ID: The image.
+ * @image: The image.
  * @num_bytes: Number of bytes in the colormap array.
  * @colormap: (array length=num_bytes) (element-type guint8): The new colormap values.
  *
@@ -1999,7 +1999,7 @@ _gimp_image_get_colormap (gint32  image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-_gimp_image_set_colormap (gint32        image_ID,
+_gimp_image_set_colormap (GimpImage    *image,
                           gint          num_bytes,
                           const guint8 *colormap)
 {
@@ -2009,7 +2009,7 @@ _gimp_image_set_colormap (gint32        image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, num_bytes,
                                           GIMP_TYPE_INT8_ARRAY, NULL,
                                           G_TYPE_NONE);
@@ -2033,7 +2033,7 @@ _gimp_image_set_colormap (gint32        image_ID,
 
 /**
  * _gimp_image_get_metadata:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the image's metadata.
  *
@@ -2043,7 +2043,7 @@ _gimp_image_set_colormap (gint32        image_ID,
  *          The returned value must be freed with g_free().
  **/
 gchar *
-_gimp_image_get_metadata (gint32 image_ID)
+_gimp_image_get_metadata (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2051,7 +2051,7 @@ _gimp_image_get_metadata (gint32 image_ID)
   gchar *metadata_string = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2073,7 +2073,7 @@ _gimp_image_get_metadata (gint32 image_ID)
 
 /**
  * _gimp_image_set_metadata:
- * @image_ID: The image.
+ * @image: The image.
  * @metadata_string: The exif/ptc/xmp metadata as a string.
  *
  * Set the image's metadata.
@@ -2083,7 +2083,7 @@ _gimp_image_get_metadata (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-_gimp_image_set_metadata (gint32       image_ID,
+_gimp_image_set_metadata (GimpImage   *image,
                           const gchar *metadata_string)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -2092,7 +2092,7 @@ _gimp_image_set_metadata (gint32       image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, metadata_string,
                                           G_TYPE_NONE);
 
@@ -2114,7 +2114,7 @@ _gimp_image_set_metadata (gint32       image_ID,
 
 /**
  * gimp_image_clean_all:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Set the image dirty count to 0.
  *
@@ -2128,7 +2128,7 @@ _gimp_image_set_metadata (gint32       image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_clean_all (gint32 image_ID)
+gimp_image_clean_all (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2136,7 +2136,7 @@ gimp_image_clean_all (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2157,7 +2157,7 @@ gimp_image_clean_all (gint32 image_ID)
 
 /**
  * gimp_image_is_dirty:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Checks if the image has unsaved changes.
  *
@@ -2169,7 +2169,7 @@ gimp_image_clean_all (gint32 image_ID)
  * Returns: TRUE if the image has unsaved changes.
  **/
 gboolean
-gimp_image_is_dirty (gint32 image_ID)
+gimp_image_is_dirty (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2177,7 +2177,7 @@ gimp_image_is_dirty (gint32 image_ID)
   gboolean dirty = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2199,7 +2199,7 @@ gimp_image_is_dirty (gint32 image_ID)
 
 /**
  * _gimp_image_thumbnail:
- * @image_ID: The image.
+ * @image: The image.
  * @width: The requested thumbnail width.
  * @height: The requested thumbnail height.
  * @actual_width: (out): The previews width.
@@ -2218,14 +2218,14 @@ gimp_image_is_dirty (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-_gimp_image_thumbnail (gint32   image_ID,
-                       gint     width,
-                       gint     height,
-                       gint    *actual_width,
-                       gint    *actual_height,
-                       gint    *bpp,
-                       gint    *thumbnail_data_count,
-                       guint8 **thumbnail_data)
+_gimp_image_thumbnail (GimpImage  *image,
+                       gint        width,
+                       gint        height,
+                       gint       *actual_width,
+                       gint       *actual_height,
+                       gint       *bpp,
+                       gint       *thumbnail_data_count,
+                       guint8    **thumbnail_data)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2233,7 +2233,7 @@ _gimp_image_thumbnail (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, width,
                                           GIMP_TYPE_INT32, height,
                                           G_TYPE_NONE);
@@ -2271,7 +2271,7 @@ _gimp_image_thumbnail (gint32   image_ID,
 
 /**
  * gimp_image_get_active_layer:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's active layer.
  *
@@ -2282,7 +2282,7 @@ _gimp_image_thumbnail (gint32   image_ID,
  * Returns: The active layer.
  **/
 gint32
-gimp_image_get_active_layer (gint32 image_ID)
+gimp_image_get_active_layer (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2290,7 +2290,7 @@ gimp_image_get_active_layer (gint32 image_ID)
   gint32 active_layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2312,7 +2312,7 @@ gimp_image_get_active_layer (gint32 image_ID)
 
 /**
  * gimp_image_set_active_layer:
- * @image_ID: The image.
+ * @image: The image.
  * @active_layer_ID: The new image active layer.
  *
  * Sets the specified image's active layer.
@@ -2325,8 +2325,8 @@ gimp_image_get_active_layer (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_active_layer (gint32 image_ID,
-                             gint32 active_layer_ID)
+gimp_image_set_active_layer (GimpImage *image,
+                             gint32     active_layer_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2334,7 +2334,7 @@ gimp_image_set_active_layer (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_LAYER_ID, active_layer_ID,
                                           G_TYPE_NONE);
 
@@ -2356,7 +2356,7 @@ gimp_image_set_active_layer (gint32 image_ID,
 
 /**
  * gimp_image_get_active_channel:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's active channel.
  *
@@ -2366,7 +2366,7 @@ gimp_image_set_active_layer (gint32 image_ID,
  * Returns: The active channel.
  **/
 gint32
-gimp_image_get_active_channel (gint32 image_ID)
+gimp_image_get_active_channel (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2374,7 +2374,7 @@ gimp_image_get_active_channel (gint32 image_ID)
   gint32 active_channel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2396,7 +2396,7 @@ gimp_image_get_active_channel (gint32 image_ID)
 
 /**
  * gimp_image_set_active_channel:
- * @image_ID: The image.
+ * @image: The image.
  * @active_channel_ID: The new image active channel.
  *
  * Sets the specified image's active channel.
@@ -2409,8 +2409,8 @@ gimp_image_get_active_channel (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_active_channel (gint32 image_ID,
-                               gint32 active_channel_ID)
+gimp_image_set_active_channel (GimpImage *image,
+                               gint32     active_channel_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2418,7 +2418,7 @@ gimp_image_set_active_channel (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_ID, active_channel_ID,
                                           G_TYPE_NONE);
 
@@ -2440,7 +2440,7 @@ gimp_image_set_active_channel (gint32 image_ID,
 
 /**
  * gimp_image_get_active_vectors:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's active vectors.
  *
@@ -2449,7 +2449,7 @@ gimp_image_set_active_channel (gint32 image_ID,
  * Returns: The active vectors.
  **/
 gint32
-gimp_image_get_active_vectors (gint32 image_ID)
+gimp_image_get_active_vectors (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2457,7 +2457,7 @@ gimp_image_get_active_vectors (gint32 image_ID)
   gint32 active_vectors_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2479,7 +2479,7 @@ gimp_image_get_active_vectors (gint32 image_ID)
 
 /**
  * gimp_image_set_active_vectors:
- * @image_ID: The image.
+ * @image: The image.
  * @active_vectors_ID: The new image active vectors.
  *
  * Sets the specified image's active vectors.
@@ -2489,8 +2489,8 @@ gimp_image_get_active_vectors (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_active_vectors (gint32 image_ID,
-                               gint32 active_vectors_ID)
+gimp_image_set_active_vectors (GimpImage *image,
+                               gint32     active_vectors_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2498,7 +2498,7 @@ gimp_image_set_active_vectors (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_VECTORS_ID, active_vectors_ID,
                                           G_TYPE_NONE);
 
@@ -2520,7 +2520,7 @@ gimp_image_set_active_vectors (gint32 image_ID,
 
 /**
  * gimp_image_get_selection:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's selection.
  *
@@ -2530,7 +2530,7 @@ gimp_image_set_active_vectors (gint32 image_ID,
  * Returns: The selection channel.
  **/
 gint32
-gimp_image_get_selection (gint32 image_ID)
+gimp_image_get_selection (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2538,7 +2538,7 @@ gimp_image_get_selection (gint32 image_ID)
   gint32 selection_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2560,7 +2560,7 @@ gimp_image_get_selection (gint32 image_ID)
 
 /**
  * gimp_image_get_component_active:
- * @image_ID: The image.
+ * @image: The image.
  * @component: The image component.
  *
  * Returns if the specified image's image component is active.
@@ -2573,8 +2573,8 @@ gimp_image_get_selection (gint32 image_ID)
  * Returns: Component is active.
  **/
 gboolean
-gimp_image_get_component_active (gint32          image_ID,
-                                 GimpChannelType component)
+gimp_image_get_component_active (GimpImage       *image,
+                                 GimpChannelType  component)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2582,7 +2582,7 @@ gimp_image_get_component_active (gint32          image_ID,
   gboolean active = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_TYPE, component,
                                           G_TYPE_NONE);
 
@@ -2605,7 +2605,7 @@ gimp_image_get_component_active (gint32          image_ID,
 
 /**
  * gimp_image_set_component_active:
- * @image_ID: The image.
+ * @image: The image.
  * @component: The image component.
  * @active: Component is active.
  *
@@ -2619,9 +2619,9 @@ gimp_image_get_component_active (gint32          image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_component_active (gint32          image_ID,
-                                 GimpChannelType component,
-                                 gboolean        active)
+gimp_image_set_component_active (GimpImage       *image,
+                                 GimpChannelType  component,
+                                 gboolean         active)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2629,7 +2629,7 @@ gimp_image_set_component_active (gint32          image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_TYPE, component,
                                           G_TYPE_BOOLEAN, active,
                                           G_TYPE_NONE);
@@ -2652,7 +2652,7 @@ gimp_image_set_component_active (gint32          image_ID,
 
 /**
  * gimp_image_get_component_visible:
- * @image_ID: The image.
+ * @image: The image.
  * @component: The image component.
  *
  * Returns if the specified image's image component is visible.
@@ -2666,8 +2666,8 @@ gimp_image_set_component_active (gint32          image_ID,
  * Returns: Component is visible.
  **/
 gboolean
-gimp_image_get_component_visible (gint32          image_ID,
-                                  GimpChannelType component)
+gimp_image_get_component_visible (GimpImage       *image,
+                                  GimpChannelType  component)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2675,7 +2675,7 @@ gimp_image_get_component_visible (gint32          image_ID,
   gboolean visible = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_TYPE, component,
                                           G_TYPE_NONE);
 
@@ -2698,7 +2698,7 @@ gimp_image_get_component_visible (gint32          image_ID,
 
 /**
  * gimp_image_set_component_visible:
- * @image_ID: The image.
+ * @image: The image.
  * @component: The image component.
  * @visible: Component is visible.
  *
@@ -2712,9 +2712,9 @@ gimp_image_get_component_visible (gint32          image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_component_visible (gint32          image_ID,
-                                  GimpChannelType component,
-                                  gboolean        visible)
+gimp_image_set_component_visible (GimpImage       *image,
+                                  GimpChannelType  component,
+                                  gboolean         visible)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2722,7 +2722,7 @@ gimp_image_set_component_visible (gint32          image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_TYPE, component,
                                           G_TYPE_BOOLEAN, visible,
                                           G_TYPE_NONE);
@@ -2745,7 +2745,7 @@ gimp_image_set_component_visible (gint32          image_ID,
 
 /**
  * gimp_image_get_filename:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's filename.
  *
@@ -2759,7 +2759,7 @@ gimp_image_set_component_visible (gint32          image_ID,
  *          The returned value must be freed with g_free().
  **/
 gchar *
-gimp_image_get_filename (gint32 image_ID)
+gimp_image_get_filename (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2767,7 +2767,7 @@ gimp_image_get_filename (gint32 image_ID)
   gchar *filename = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2789,7 +2789,7 @@ gimp_image_get_filename (gint32 image_ID)
 
 /**
  * gimp_image_set_filename:
- * @image_ID: The image.
+ * @image: The image.
  * @filename: The new image filename.
  *
  * Sets the specified image's filename.
@@ -2800,7 +2800,7 @@ gimp_image_get_filename (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_filename (gint32       image_ID,
+gimp_image_set_filename (GimpImage   *image,
                          const gchar *filename)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -2809,7 +2809,7 @@ gimp_image_set_filename (gint32       image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, filename,
                                           G_TYPE_NONE);
 
@@ -2831,7 +2831,7 @@ gimp_image_set_filename (gint32       image_ID,
 
 /**
  * gimp_image_get_uri:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the URI for the specified image.
  *
@@ -2849,7 +2849,7 @@ gimp_image_set_filename (gint32       image_ID,
  * Since: 2.8
  **/
 gchar *
-gimp_image_get_uri (gint32 image_ID)
+gimp_image_get_uri (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2857,7 +2857,7 @@ gimp_image_get_uri (gint32 image_ID)
   gchar *uri = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2879,7 +2879,7 @@ gimp_image_get_uri (gint32 image_ID)
 
 /**
  * gimp_image_get_xcf_uri:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the XCF URI for the specified image.
  *
@@ -2892,7 +2892,7 @@ gimp_image_get_uri (gint32 image_ID)
  * Since: 2.8
  **/
 gchar *
-gimp_image_get_xcf_uri (gint32 image_ID)
+gimp_image_get_xcf_uri (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2900,7 +2900,7 @@ gimp_image_get_xcf_uri (gint32 image_ID)
   gchar *uri = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2922,7 +2922,7 @@ gimp_image_get_xcf_uri (gint32 image_ID)
 
 /**
  * gimp_image_get_imported_uri:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the imported URI for the specified image.
  *
@@ -2937,7 +2937,7 @@ gimp_image_get_xcf_uri (gint32 image_ID)
  * Since: 2.8
  **/
 gchar *
-gimp_image_get_imported_uri (gint32 image_ID)
+gimp_image_get_imported_uri (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2945,7 +2945,7 @@ gimp_image_get_imported_uri (gint32 image_ID)
   gchar *uri = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -2967,7 +2967,7 @@ gimp_image_get_imported_uri (gint32 image_ID)
 
 /**
  * gimp_image_get_exported_uri:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the exported URI for the specified image.
  *
@@ -2981,7 +2981,7 @@ gimp_image_get_imported_uri (gint32 image_ID)
  * Since: 2.8
  **/
 gchar *
-gimp_image_get_exported_uri (gint32 image_ID)
+gimp_image_get_exported_uri (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -2989,7 +2989,7 @@ gimp_image_get_exported_uri (gint32 image_ID)
   gchar *uri = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -3011,7 +3011,7 @@ gimp_image_get_exported_uri (gint32 image_ID)
 
 /**
  * gimp_image_get_name:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's name.
  *
@@ -3027,7 +3027,7 @@ gimp_image_get_exported_uri (gint32 image_ID)
  *          The returned value must be freed with g_free().
  **/
 gchar *
-gimp_image_get_name (gint32 image_ID)
+gimp_image_get_name (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3035,7 +3035,7 @@ gimp_image_get_name (gint32 image_ID)
   gchar *name = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -3057,7 +3057,7 @@ gimp_image_get_name (gint32 image_ID)
 
 /**
  * gimp_image_get_resolution:
- * @image_ID: The image.
+ * @image: The image.
  * @xresolution: (out): The resolution in the x-axis, in dots per inch.
  * @yresolution: (out): The resolution in the y-axis, in dots per inch.
  *
@@ -3069,9 +3069,9 @@ gimp_image_get_name (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_get_resolution (gint32   image_ID,
-                           gdouble *xresolution,
-                           gdouble *yresolution)
+gimp_image_get_resolution (GimpImage *image,
+                           gdouble   *xresolution,
+                           gdouble   *yresolution)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3079,7 +3079,7 @@ gimp_image_get_resolution (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -3109,7 +3109,7 @@ gimp_image_get_resolution (gint32   image_ID,
 
 /**
  * gimp_image_set_resolution:
- * @image_ID: The image.
+ * @image: The image.
  * @xresolution: The new image resolution in the x-axis, in dots per inch.
  * @yresolution: The new image resolution in the y-axis, in dots per inch.
  *
@@ -3122,9 +3122,9 @@ gimp_image_get_resolution (gint32   image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_resolution (gint32  image_ID,
-                           gdouble xresolution,
-                           gdouble yresolution)
+gimp_image_set_resolution (GimpImage *image,
+                           gdouble    xresolution,
+                           gdouble    yresolution)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3132,7 +3132,7 @@ gimp_image_set_resolution (gint32  image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_DOUBLE, xresolution,
                                           G_TYPE_DOUBLE, yresolution,
                                           G_TYPE_NONE);
@@ -3155,7 +3155,7 @@ gimp_image_set_resolution (gint32  image_ID,
 
 /**
  * gimp_image_get_unit:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the specified image's unit.
  *
@@ -3167,7 +3167,7 @@ gimp_image_set_resolution (gint32  image_ID,
  * Returns: (transfer none): The unit.
  **/
 GimpUnit
-gimp_image_get_unit (gint32 image_ID)
+gimp_image_get_unit (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3175,7 +3175,7 @@ gimp_image_get_unit (gint32 image_ID)
   GimpUnit unit = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -3197,7 +3197,7 @@ gimp_image_get_unit (gint32 image_ID)
 
 /**
  * gimp_image_set_unit:
- * @image_ID: The image.
+ * @image: The image.
  * @unit: The new image unit.
  *
  * Sets the specified image's unit.
@@ -3211,8 +3211,8 @@ gimp_image_get_unit (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_unit (gint32   image_ID,
-                     GimpUnit unit)
+gimp_image_set_unit (GimpImage *image,
+                     GimpUnit   unit)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3220,7 +3220,7 @@ gimp_image_set_unit (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_UNIT, unit,
                                           G_TYPE_NONE);
 
@@ -3242,7 +3242,7 @@ gimp_image_set_unit (gint32   image_ID,
 
 /**
  * gimp_image_get_tattoo_state:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Returns the tattoo state associated with the image.
  *
@@ -3253,7 +3253,7 @@ gimp_image_set_unit (gint32   image_ID,
  * Returns: The tattoo state.
  **/
 gint
-gimp_image_get_tattoo_state (gint32 image_ID)
+gimp_image_get_tattoo_state (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3261,7 +3261,7 @@ gimp_image_get_tattoo_state (gint32 image_ID)
   gint tattoo_state = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -3283,7 +3283,7 @@ gimp_image_get_tattoo_state (gint32 image_ID)
 
 /**
  * gimp_image_set_tattoo_state:
- * @image_ID: The image.
+ * @image: The image.
  * @tattoo_state: The new image tattoo state.
  *
  * Set the tattoo state associated with the image.
@@ -3304,8 +3304,8 @@ gimp_image_get_tattoo_state (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_set_tattoo_state (gint32 image_ID,
-                             gint   tattoo_state)
+gimp_image_set_tattoo_state (GimpImage *image,
+                             gint       tattoo_state)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3313,7 +3313,7 @@ gimp_image_set_tattoo_state (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, tattoo_state,
                                           G_TYPE_NONE);
 
@@ -3335,7 +3335,7 @@ gimp_image_set_tattoo_state (gint32 image_ID,
 
 /**
  * gimp_image_get_layer_by_tattoo:
- * @image_ID: The image.
+ * @image: The image.
  * @tattoo: The tattoo of the layer to find.
  *
  * Find a layer with a given tattoo in an image.
@@ -3346,8 +3346,8 @@ gimp_image_set_tattoo_state (gint32 image_ID,
  * Returns: The layer with the specified tattoo.
  **/
 gint32
-gimp_image_get_layer_by_tattoo (gint32 image_ID,
-                                gint   tattoo)
+gimp_image_get_layer_by_tattoo (GimpImage *image,
+                                gint       tattoo)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3355,7 +3355,7 @@ gimp_image_get_layer_by_tattoo (gint32 image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, tattoo,
                                           G_TYPE_NONE);
 
@@ -3378,7 +3378,7 @@ gimp_image_get_layer_by_tattoo (gint32 image_ID,
 
 /**
  * gimp_image_get_channel_by_tattoo:
- * @image_ID: The image.
+ * @image: The image.
  * @tattoo: The tattoo of the channel to find.
  *
  * Find a channel with a given tattoo in an image.
@@ -3389,8 +3389,8 @@ gimp_image_get_layer_by_tattoo (gint32 image_ID,
  * Returns: The channel with the specified tattoo.
  **/
 gint32
-gimp_image_get_channel_by_tattoo (gint32 image_ID,
-                                  gint   tattoo)
+gimp_image_get_channel_by_tattoo (GimpImage *image,
+                                  gint       tattoo)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3398,7 +3398,7 @@ gimp_image_get_channel_by_tattoo (gint32 image_ID,
   gint32 channel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, tattoo,
                                           G_TYPE_NONE);
 
@@ -3421,7 +3421,7 @@ gimp_image_get_channel_by_tattoo (gint32 image_ID,
 
 /**
  * gimp_image_get_vectors_by_tattoo:
- * @image_ID: The image.
+ * @image: The image.
  * @tattoo: The tattoo of the vectors to find.
  *
  * Find a vectors with a given tattoo in an image.
@@ -3434,8 +3434,8 @@ gimp_image_get_channel_by_tattoo (gint32 image_ID,
  * Since: 2.6
  **/
 gint32
-gimp_image_get_vectors_by_tattoo (gint32 image_ID,
-                                  gint   tattoo)
+gimp_image_get_vectors_by_tattoo (GimpImage *image,
+                                  gint       tattoo)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3443,7 +3443,7 @@ gimp_image_get_vectors_by_tattoo (gint32 image_ID,
   gint32 vectors_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, tattoo,
                                           G_TYPE_NONE);
 
@@ -3466,7 +3466,7 @@ gimp_image_get_vectors_by_tattoo (gint32 image_ID,
 
 /**
  * gimp_image_get_layer_by_name:
- * @image_ID: The image.
+ * @image: The image.
  * @name: The name of the layer to find.
  *
  * Find a layer with a given name in an image.
@@ -3479,7 +3479,7 @@ gimp_image_get_vectors_by_tattoo (gint32 image_ID,
  * Since: 2.8
  **/
 gint32
-gimp_image_get_layer_by_name (gint32       image_ID,
+gimp_image_get_layer_by_name (GimpImage   *image,
                               const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -3488,7 +3488,7 @@ gimp_image_get_layer_by_name (gint32       image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -3511,7 +3511,7 @@ gimp_image_get_layer_by_name (gint32       image_ID,
 
 /**
  * gimp_image_get_channel_by_name:
- * @image_ID: The image.
+ * @image: The image.
  * @name: The name of the channel to find.
  *
  * Find a channel with a given name in an image.
@@ -3524,7 +3524,7 @@ gimp_image_get_layer_by_name (gint32       image_ID,
  * Since: 2.8
  **/
 gint32
-gimp_image_get_channel_by_name (gint32       image_ID,
+gimp_image_get_channel_by_name (GimpImage   *image,
                                 const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -3533,7 +3533,7 @@ gimp_image_get_channel_by_name (gint32       image_ID,
   gint32 channel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -3556,7 +3556,7 @@ gimp_image_get_channel_by_name (gint32       image_ID,
 
 /**
  * gimp_image_get_vectors_by_name:
- * @image_ID: The image.
+ * @image: The image.
  * @name: The name of the vectors to find.
  *
  * Find a vectors with a given name in an image.
@@ -3569,7 +3569,7 @@ gimp_image_get_channel_by_name (gint32       image_ID,
  * Since: 2.8
  **/
 gint32
-gimp_image_get_vectors_by_name (gint32       image_ID,
+gimp_image_get_vectors_by_name (GimpImage   *image,
                                 const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -3578,7 +3578,7 @@ gimp_image_get_vectors_by_name (gint32       image_ID,
   gint32 vectors_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -3601,7 +3601,7 @@ gimp_image_get_vectors_by_name (gint32       image_ID,
 
 /**
  * gimp_image_attach_parasite:
- * @image_ID: The image.
+ * @image: The image.
  * @parasite: The parasite to attach to an image.
  *
  * Add a parasite to an image.
@@ -3614,7 +3614,7 @@ gimp_image_get_vectors_by_name (gint32       image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_attach_parasite (gint32              image_ID,
+gimp_image_attach_parasite (GimpImage          *image,
                             const GimpParasite *parasite)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -3623,7 +3623,7 @@ gimp_image_attach_parasite (gint32              image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_PARASITE, parasite,
                                           G_TYPE_NONE);
 
@@ -3645,7 +3645,7 @@ gimp_image_attach_parasite (gint32              image_ID,
 
 /**
  * gimp_image_detach_parasite:
- * @image_ID: The image.
+ * @image: The image.
  * @name: The name of the parasite to detach from an image.
  *
  * Removes a parasite from an image.
@@ -3658,7 +3658,7 @@ gimp_image_attach_parasite (gint32              image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_detach_parasite (gint32       image_ID,
+gimp_image_detach_parasite (GimpImage   *image,
                             const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -3667,7 +3667,7 @@ gimp_image_detach_parasite (gint32       image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -3689,7 +3689,7 @@ gimp_image_detach_parasite (gint32       image_ID,
 
 /**
  * gimp_image_get_parasite:
- * @image_ID: The image.
+ * @image: The image.
  * @name: The name of the parasite to find.
  *
  * Look up a parasite in an image
@@ -3702,7 +3702,7 @@ gimp_image_detach_parasite (gint32       image_ID,
  * Since: 2.8
  **/
 GimpParasite *
-gimp_image_get_parasite (gint32       image_ID,
+gimp_image_get_parasite (GimpImage   *image,
                          const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -3711,7 +3711,7 @@ gimp_image_get_parasite (gint32       image_ID,
   GimpParasite *parasite = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -3734,7 +3734,7 @@ gimp_image_get_parasite (gint32       image_ID,
 
 /**
  * gimp_image_get_parasite_list:
- * @image_ID: The image.
+ * @image: The image.
  * @num_parasites: (out): The number of attached parasites.
  *
  * List all parasites.
@@ -3748,8 +3748,8 @@ gimp_image_get_parasite (gint32       image_ID,
  * Since: 2.8
  **/
 gchar **
-gimp_image_get_parasite_list (gint32  image_ID,
-                              gint   *num_parasites)
+gimp_image_get_parasite_list (GimpImage *image,
+                              gint      *num_parasites)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -3757,7 +3757,7 @@ gimp_image_get_parasite_list (gint32  image_ID,
   gchar **parasites = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
diff --git a/libgimp/gimpimage_pdb.h b/libgimp/gimpimage_pdb.h
index 10f2a887b0..9be11fb706 100644
--- a/libgimp/gimpimage_pdb.h
+++ b/libgimp/gimpimage_pdb.h
@@ -32,33 +32,33 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean                 gimp_image_is_valid                   (gint32               image_ID);
+gboolean                 gimp_image_is_valid                   (GimpImage           *image);
 gint*                    gimp_image_list                       (gint                *num_images);
-gint32                   gimp_image_new                        (gint                 width,
+GimpImage*               gimp_image_new                        (gint                 width,
                                                                 gint                 height,
                                                                 GimpImageBaseType    type);
-gint32                   gimp_image_new_with_precision         (gint                 width,
+GimpImage*               gimp_image_new_with_precision         (gint                 width,
                                                                 gint                 height,
                                                                 GimpImageBaseType    type,
                                                                 GimpPrecision        precision);
-gint32                   gimp_image_duplicate                  (gint32               image_ID);
-gboolean                 gimp_image_delete                     (gint32               image_ID);
-GimpImageBaseType        gimp_image_base_type                  (gint32               image_ID);
-GimpPrecision            gimp_image_get_precision              (gint32               image_ID);
-GimpLayerMode            gimp_image_get_default_new_layer_mode (gint32               image_ID);
-gint                     gimp_image_width                      (gint32               image_ID);
-gint                     gimp_image_height                     (gint32               image_ID);
-gint*                    gimp_image_get_layers                 (gint32               image_ID,
+GimpImage*               gimp_image_duplicate                  (GimpImage           *image);
+gboolean                 gimp_image_delete                     (GimpImage           *image);
+GimpImageBaseType        gimp_image_base_type                  (GimpImage           *image);
+GimpPrecision            gimp_image_get_precision              (GimpImage           *image);
+GimpLayerMode            gimp_image_get_default_new_layer_mode (GimpImage           *image);
+gint                     gimp_image_width                      (GimpImage           *image);
+gint                     gimp_image_height                     (GimpImage           *image);
+gint*                    gimp_image_get_layers                 (GimpImage           *image,
                                                                 gint                *num_layers);
-gint*                    gimp_image_get_channels               (gint32               image_ID,
+gint*                    gimp_image_get_channels               (GimpImage           *image,
                                                                 gint                *num_channels);
-gint*                    gimp_image_get_vectors                (gint32               image_ID,
+gint*                    gimp_image_get_vectors                (GimpImage           *image,
                                                                 gint                *num_vectors);
-gint32                   gimp_image_get_active_drawable        (gint32               image_ID);
-gboolean                 gimp_image_unset_active_channel       (gint32               image_ID);
-gint32                   gimp_image_get_floating_sel           (gint32               image_ID);
-gint32                   gimp_image_floating_sel_attached_to   (gint32               image_ID);
-gboolean                 gimp_image_pick_color                 (gint32               image_ID,
+gint32                   gimp_image_get_active_drawable        (GimpImage           *image);
+gboolean                 gimp_image_unset_active_channel       (GimpImage           *image);
+gint32                   gimp_image_get_floating_sel           (GimpImage           *image);
+gint32                   gimp_image_floating_sel_attached_to   (GimpImage           *image);
+gboolean                 gimp_image_pick_color                 (GimpImage           *image,
                                                                 gint32               drawable_ID,
                                                                 gdouble              x,
                                                                 gdouble              y,
@@ -66,64 +66,64 @@ gboolean                 gimp_image_pick_color                 (gint32
                                                                 gboolean             sample_average,
                                                                 gdouble              average_radius,
                                                                 GimpRGB             *color);
-gint32                   gimp_image_pick_correlate_layer       (gint32               image_ID,
+gint32                   gimp_image_pick_correlate_layer       (GimpImage           *image,
                                                                 gint                 x,
                                                                 gint                 y);
-gboolean                 gimp_image_insert_layer               (gint32               image_ID,
+gboolean                 gimp_image_insert_layer               (GimpImage           *image,
                                                                 gint32               layer_ID,
                                                                 gint32               parent_ID,
                                                                 gint                 position);
-gboolean                 gimp_image_remove_layer               (gint32               image_ID,
+gboolean                 gimp_image_remove_layer               (GimpImage           *image,
                                                                 gint32               layer_ID);
-gboolean                 gimp_image_freeze_layers              (gint32               image_ID);
-gboolean                 gimp_image_thaw_layers                (gint32               image_ID);
-gboolean                 gimp_image_insert_channel             (gint32               image_ID,
+gboolean                 gimp_image_freeze_layers              (GimpImage           *image);
+gboolean                 gimp_image_thaw_layers                (GimpImage           *image);
+gboolean                 gimp_image_insert_channel             (GimpImage           *image,
                                                                 gint32               channel_ID,
                                                                 gint32               parent_ID,
                                                                 gint                 position);
-gboolean                 gimp_image_remove_channel             (gint32               image_ID,
+gboolean                 gimp_image_remove_channel             (GimpImage           *image,
                                                                 gint32               channel_ID);
-gboolean                 gimp_image_freeze_channels            (gint32               image_ID);
-gboolean                 gimp_image_thaw_channels              (gint32               image_ID);
-gboolean                 gimp_image_insert_vectors             (gint32               image_ID,
+gboolean                 gimp_image_freeze_channels            (GimpImage           *image);
+gboolean                 gimp_image_thaw_channels              (GimpImage           *image);
+gboolean                 gimp_image_insert_vectors             (GimpImage           *image,
                                                                 gint32               vectors_ID,
                                                                 gint32               parent_ID,
                                                                 gint                 position);
-gboolean                 gimp_image_remove_vectors             (gint32               image_ID,
+gboolean                 gimp_image_remove_vectors             (GimpImage           *image,
                                                                 gint32               vectors_ID);
-gboolean                 gimp_image_freeze_vectors             (gint32               image_ID);
-gboolean                 gimp_image_thaw_vectors               (gint32               image_ID);
-gint                     gimp_image_get_item_position          (gint32               image_ID,
+gboolean                 gimp_image_freeze_vectors             (GimpImage           *image);
+gboolean                 gimp_image_thaw_vectors               (GimpImage           *image);
+gint                     gimp_image_get_item_position          (GimpImage           *image,
                                                                 gint32               item_ID);
-gboolean                 gimp_image_raise_item                 (gint32               image_ID,
+gboolean                 gimp_image_raise_item                 (GimpImage           *image,
                                                                 gint32               item_ID);
-gboolean                 gimp_image_lower_item                 (gint32               image_ID,
+gboolean                 gimp_image_lower_item                 (GimpImage           *image,
                                                                 gint32               item_ID);
-gboolean                 gimp_image_raise_item_to_top          (gint32               image_ID,
+gboolean                 gimp_image_raise_item_to_top          (GimpImage           *image,
                                                                 gint32               item_ID);
-gboolean                 gimp_image_lower_item_to_bottom       (gint32               image_ID,
+gboolean                 gimp_image_lower_item_to_bottom       (GimpImage           *image,
                                                                 gint32               item_ID);
-gboolean                 gimp_image_reorder_item               (gint32               image_ID,
+gboolean                 gimp_image_reorder_item               (GimpImage           *image,
                                                                 gint32               item_ID,
                                                                 gint32               parent_ID,
                                                                 gint                 position);
-gint32                   gimp_image_flatten                    (gint32               image_ID);
-gint32                   gimp_image_merge_visible_layers       (gint32               image_ID,
+gint32                   gimp_image_flatten                    (GimpImage           *image);
+gint32                   gimp_image_merge_visible_layers       (GimpImage           *image,
                                                                 GimpMergeType        merge_type);
-gint32                   gimp_image_merge_down                 (gint32               image_ID,
+gint32                   gimp_image_merge_down                 (GimpImage           *image,
                                                                 gint32               merge_layer_ID,
                                                                 GimpMergeType        merge_type);
-G_GNUC_INTERNAL guint8*  _gimp_image_get_colormap              (gint32               image_ID,
+G_GNUC_INTERNAL guint8*  _gimp_image_get_colormap              (GimpImage           *image,
                                                                 gint                *num_bytes);
-G_GNUC_INTERNAL gboolean _gimp_image_set_colormap              (gint32               image_ID,
+G_GNUC_INTERNAL gboolean _gimp_image_set_colormap              (GimpImage           *image,
                                                                 gint                 num_bytes,
                                                                 const guint8        *colormap);
-G_GNUC_INTERNAL gchar*   _gimp_image_get_metadata              (gint32               image_ID);
-G_GNUC_INTERNAL gboolean _gimp_image_set_metadata              (gint32               image_ID,
+G_GNUC_INTERNAL gchar*   _gimp_image_get_metadata              (GimpImage           *image);
+G_GNUC_INTERNAL gboolean _gimp_image_set_metadata              (GimpImage           *image,
                                                                 const gchar         *metadata_string);
-gboolean                 gimp_image_clean_all                  (gint32               image_ID);
-gboolean                 gimp_image_is_dirty                   (gint32               image_ID);
-G_GNUC_INTERNAL gboolean _gimp_image_thumbnail                 (gint32               image_ID,
+gboolean                 gimp_image_clean_all                  (GimpImage           *image);
+gboolean                 gimp_image_is_dirty                   (GimpImage           *image);
+G_GNUC_INTERNAL gboolean _gimp_image_thumbnail                 (GimpImage           *image,
                                                                 gint                 width,
                                                                 gint                 height,
                                                                 gint                *actual_width,
@@ -131,65 +131,65 @@ G_GNUC_INTERNAL gboolean _gimp_image_thumbnail                 (gint32
                                                                 gint                *bpp,
                                                                 gint                *thumbnail_data_count,
                                                                 guint8             **thumbnail_data);
-gint32                   gimp_image_get_active_layer           (gint32               image_ID);
-gboolean                 gimp_image_set_active_layer           (gint32               image_ID,
+gint32                   gimp_image_get_active_layer           (GimpImage           *image);
+gboolean                 gimp_image_set_active_layer           (GimpImage           *image,
                                                                 gint32               active_layer_ID);
-gint32                   gimp_image_get_active_channel         (gint32               image_ID);
-gboolean                 gimp_image_set_active_channel         (gint32               image_ID,
+gint32                   gimp_image_get_active_channel         (GimpImage           *image);
+gboolean                 gimp_image_set_active_channel         (GimpImage           *image,
                                                                 gint32               active_channel_ID);
-gint32                   gimp_image_get_active_vectors         (gint32               image_ID);
-gboolean                 gimp_image_set_active_vectors         (gint32               image_ID,
+gint32                   gimp_image_get_active_vectors         (GimpImage           *image);
+gboolean                 gimp_image_set_active_vectors         (GimpImage           *image,
                                                                 gint32               active_vectors_ID);
-gint32                   gimp_image_get_selection              (gint32               image_ID);
-gboolean                 gimp_image_get_component_active       (gint32               image_ID,
+gint32                   gimp_image_get_selection              (GimpImage           *image);
+gboolean                 gimp_image_get_component_active       (GimpImage           *image,
                                                                 GimpChannelType      component);
-gboolean                 gimp_image_set_component_active       (gint32               image_ID,
+gboolean                 gimp_image_set_component_active       (GimpImage           *image,
                                                                 GimpChannelType      component,
                                                                 gboolean             active);
-gboolean                 gimp_image_get_component_visible      (gint32               image_ID,
+gboolean                 gimp_image_get_component_visible      (GimpImage           *image,
                                                                 GimpChannelType      component);
-gboolean                 gimp_image_set_component_visible      (gint32               image_ID,
+gboolean                 gimp_image_set_component_visible      (GimpImage           *image,
                                                                 GimpChannelType      component,
                                                                 gboolean             visible);
-gchar*                   gimp_image_get_filename               (gint32               image_ID);
-gboolean                 gimp_image_set_filename               (gint32               image_ID,
+gchar*                   gimp_image_get_filename               (GimpImage           *image);
+gboolean                 gimp_image_set_filename               (GimpImage           *image,
                                                                 const gchar         *filename);
-gchar*                   gimp_image_get_uri                    (gint32               image_ID);
-gchar*                   gimp_image_get_xcf_uri                (gint32               image_ID);
-gchar*                   gimp_image_get_imported_uri           (gint32               image_ID);
-gchar*                   gimp_image_get_exported_uri           (gint32               image_ID);
-gchar*                   gimp_image_get_name                   (gint32               image_ID);
-gboolean                 gimp_image_get_resolution             (gint32               image_ID,
+gchar*                   gimp_image_get_uri                    (GimpImage           *image);
+gchar*                   gimp_image_get_xcf_uri                (GimpImage           *image);
+gchar*                   gimp_image_get_imported_uri           (GimpImage           *image);
+gchar*                   gimp_image_get_exported_uri           (GimpImage           *image);
+gchar*                   gimp_image_get_name                   (GimpImage           *image);
+gboolean                 gimp_image_get_resolution             (GimpImage           *image,
                                                                 gdouble             *xresolution,
                                                                 gdouble             *yresolution);
-gboolean                 gimp_image_set_resolution             (gint32               image_ID,
+gboolean                 gimp_image_set_resolution             (GimpImage           *image,
                                                                 gdouble              xresolution,
                                                                 gdouble              yresolution);
-GimpUnit                 gimp_image_get_unit                   (gint32               image_ID);
-gboolean                 gimp_image_set_unit                   (gint32               image_ID,
+GimpUnit                 gimp_image_get_unit                   (GimpImage           *image);
+gboolean                 gimp_image_set_unit                   (GimpImage           *image,
                                                                 GimpUnit             unit);
-gint                     gimp_image_get_tattoo_state           (gint32               image_ID);
-gboolean                 gimp_image_set_tattoo_state           (gint32               image_ID,
+gint                     gimp_image_get_tattoo_state           (GimpImage           *image);
+gboolean                 gimp_image_set_tattoo_state           (GimpImage           *image,
                                                                 gint                 tattoo_state);
-gint32                   gimp_image_get_layer_by_tattoo        (gint32               image_ID,
+gint32                   gimp_image_get_layer_by_tattoo        (GimpImage           *image,
                                                                 gint                 tattoo);
-gint32                   gimp_image_get_channel_by_tattoo      (gint32               image_ID,
+gint32                   gimp_image_get_channel_by_tattoo      (GimpImage           *image,
                                                                 gint                 tattoo);
-gint32                   gimp_image_get_vectors_by_tattoo      (gint32               image_ID,
+gint32                   gimp_image_get_vectors_by_tattoo      (GimpImage           *image,
                                                                 gint                 tattoo);
-gint32                   gimp_image_get_layer_by_name          (gint32               image_ID,
+gint32                   gimp_image_get_layer_by_name          (GimpImage           *image,
                                                                 const gchar         *name);
-gint32                   gimp_image_get_channel_by_name        (gint32               image_ID,
+gint32                   gimp_image_get_channel_by_name        (GimpImage           *image,
                                                                 const gchar         *name);
-gint32                   gimp_image_get_vectors_by_name        (gint32               image_ID,
+gint32                   gimp_image_get_vectors_by_name        (GimpImage           *image,
                                                                 const gchar         *name);
-gboolean                 gimp_image_attach_parasite            (gint32               image_ID,
+gboolean                 gimp_image_attach_parasite            (GimpImage           *image,
                                                                 const GimpParasite  *parasite);
-gboolean                 gimp_image_detach_parasite            (gint32               image_ID,
+gboolean                 gimp_image_detach_parasite            (GimpImage           *image,
                                                                 const gchar         *name);
-GimpParasite*            gimp_image_get_parasite               (gint32               image_ID,
+GimpParasite*            gimp_image_get_parasite               (GimpImage           *image,
                                                                 const gchar         *name);
-gchar**                  gimp_image_get_parasite_list          (gint32               image_ID,
+gchar**                  gimp_image_get_parasite_list          (GimpImage           *image,
                                                                 gint                *num_parasites);
 
 
diff --git a/libgimp/gimpimagecolorprofile_pdb.c b/libgimp/gimpimagecolorprofile_pdb.c
index e450b6cab2..25563a3f85 100644
--- a/libgimp/gimpimagecolorprofile_pdb.c
+++ b/libgimp/gimpimagecolorprofile_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * _gimp_image_get_color_profile:
- * @image_ID: The image.
+ * @image: The image.
  * @num_bytes: (out): Number of bytes in the color_profile array.
  *
  * Returns the image's color profile
@@ -51,8 +51,8 @@
  * Since: 2.10
  **/
 guint8 *
-_gimp_image_get_color_profile (gint32  image_ID,
-                               gint   *num_bytes)
+_gimp_image_get_color_profile (GimpImage *image,
+                               gint      *num_bytes)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -60,7 +60,7 @@ _gimp_image_get_color_profile (gint32  image_ID,
   guint8 *profile_data = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -87,7 +87,7 @@ _gimp_image_get_color_profile (gint32  image_ID,
 
 /**
  * _gimp_image_get_effective_color_profile:
- * @image_ID: The image.
+ * @image: The image.
  * @num_bytes: (out): Number of bytes in the color_profile array.
  *
  * Returns the color profile that is used for the image
@@ -105,8 +105,8 @@ _gimp_image_get_color_profile (gint32  image_ID,
  * Since: 2.10
  **/
 guint8 *
-_gimp_image_get_effective_color_profile (gint32  image_ID,
-                                         gint   *num_bytes)
+_gimp_image_get_effective_color_profile (GimpImage *image,
+                                         gint      *num_bytes)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -114,7 +114,7 @@ _gimp_image_get_effective_color_profile (gint32  image_ID,
   guint8 *profile_data = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -141,7 +141,7 @@ _gimp_image_get_effective_color_profile (gint32  image_ID,
 
 /**
  * _gimp_image_set_color_profile:
- * @image_ID: The image.
+ * @image: The image.
  * @num_bytes: Number of bytes in the color_profile array.
  * @color_profile: (array length=num_bytes) (element-type guint8): The new serialized color profile.
  *
@@ -158,7 +158,7 @@ _gimp_image_get_effective_color_profile (gint32  image_ID,
  * Since: 2.10
  **/
 gboolean
-_gimp_image_set_color_profile (gint32        image_ID,
+_gimp_image_set_color_profile (GimpImage    *image,
                                gint          num_bytes,
                                const guint8 *color_profile)
 {
@@ -168,7 +168,7 @@ _gimp_image_set_color_profile (gint32        image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, num_bytes,
                                           GIMP_TYPE_INT8_ARRAY, NULL,
                                           G_TYPE_NONE);
@@ -192,7 +192,7 @@ _gimp_image_set_color_profile (gint32        image_ID,
 
 /**
  * gimp_image_set_color_profile_from_file:
- * @image_ID: The image.
+ * @image: The image.
  * @uri: The URI of the file containing the new color profile.
  *
  * Sets the image's color profile from an ICC file
@@ -209,7 +209,7 @@ _gimp_image_set_color_profile (gint32        image_ID,
  * Since: 2.10
  **/
 gboolean
-gimp_image_set_color_profile_from_file (gint32       image_ID,
+gimp_image_set_color_profile_from_file (GimpImage   *image,
                                         const gchar *uri)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -218,7 +218,7 @@ gimp_image_set_color_profile_from_file (gint32       image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, uri,
                                           G_TYPE_NONE);
 
@@ -240,7 +240,7 @@ gimp_image_set_color_profile_from_file (gint32       image_ID,
 
 /**
  * _gimp_image_convert_color_profile:
- * @image_ID: The image.
+ * @image: The image.
  * @num_bytes: Number of bytes in the color_profile array.
  * @color_profile: (array length=num_bytes) (element-type guint8): The serialized color profile.
  * @intent: Rendering intent.
@@ -258,7 +258,7 @@ gimp_image_set_color_profile_from_file (gint32       image_ID,
  * Since: 2.10
  **/
 gboolean
-_gimp_image_convert_color_profile (gint32                    image_ID,
+_gimp_image_convert_color_profile (GimpImage                *image,
                                    gint                      num_bytes,
                                    const guint8             *color_profile,
                                    GimpColorRenderingIntent  intent,
@@ -270,7 +270,7 @@ _gimp_image_convert_color_profile (gint32                    image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, num_bytes,
                                           GIMP_TYPE_INT8_ARRAY, NULL,
                                           GIMP_TYPE_COLOR_RENDERING_INTENT, intent,
@@ -296,7 +296,7 @@ _gimp_image_convert_color_profile (gint32                    image_ID,
 
 /**
  * gimp_image_convert_color_profile_from_file:
- * @image_ID: The image.
+ * @image: The image.
  * @uri: The URI of the file containing the new color profile.
  * @intent: Rendering intent.
  * @bpc: Black point compensation.
@@ -313,7 +313,7 @@ _gimp_image_convert_color_profile (gint32                    image_ID,
  * Since: 2.10
  **/
 gboolean
-gimp_image_convert_color_profile_from_file (gint32                    image_ID,
+gimp_image_convert_color_profile_from_file (GimpImage                *image,
                                             const gchar              *uri,
                                             GimpColorRenderingIntent  intent,
                                             gboolean                  bpc)
@@ -324,7 +324,7 @@ gimp_image_convert_color_profile_from_file (gint32                    image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, uri,
                                           GIMP_TYPE_COLOR_RENDERING_INTENT, intent,
                                           G_TYPE_BOOLEAN, bpc,
diff --git a/libgimp/gimpimagecolorprofile_pdb.h b/libgimp/gimpimagecolorprofile_pdb.h
index 4a76cbfe29..454a837bfe 100644
--- a/libgimp/gimpimagecolorprofile_pdb.h
+++ b/libgimp/gimpimagecolorprofile_pdb.h
@@ -32,21 +32,21 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-G_GNUC_INTERNAL guint8*  _gimp_image_get_color_profile              (gint32                    image_ID,
+G_GNUC_INTERNAL guint8*  _gimp_image_get_color_profile              (GimpImage                *image,
                                                                      gint                     *num_bytes);
-G_GNUC_INTERNAL guint8*  _gimp_image_get_effective_color_profile    (gint32                    image_ID,
+G_GNUC_INTERNAL guint8*  _gimp_image_get_effective_color_profile    (GimpImage                *image,
                                                                      gint                     *num_bytes);
-G_GNUC_INTERNAL gboolean _gimp_image_set_color_profile              (gint32                    image_ID,
+G_GNUC_INTERNAL gboolean _gimp_image_set_color_profile              (GimpImage                *image,
                                                                      gint                      num_bytes,
                                                                      const guint8             
*color_profile);
-gboolean                 gimp_image_set_color_profile_from_file     (gint32                    image_ID,
+gboolean                 gimp_image_set_color_profile_from_file     (GimpImage                *image,
                                                                      const gchar              *uri);
-G_GNUC_INTERNAL gboolean _gimp_image_convert_color_profile          (gint32                    image_ID,
+G_GNUC_INTERNAL gboolean _gimp_image_convert_color_profile          (GimpImage                *image,
                                                                      gint                      num_bytes,
                                                                      const guint8             *color_profile,
                                                                      GimpColorRenderingIntent  intent,
                                                                      gboolean                  bpc);
-gboolean                 gimp_image_convert_color_profile_from_file (gint32                    image_ID,
+gboolean                 gimp_image_convert_color_profile_from_file (GimpImage                *image,
                                                                      const gchar              *uri,
                                                                      GimpColorRenderingIntent  intent,
                                                                      gboolean                  bpc);
diff --git a/libgimp/gimpimageconvert_pdb.c b/libgimp/gimpimageconvert_pdb.c
index 7dcf1e324e..8572edfd5c 100644
--- a/libgimp/gimpimageconvert_pdb.c
+++ b/libgimp/gimpimageconvert_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_convert_rgb:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Convert specified image to RGB color
  *
@@ -48,7 +48,7 @@
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_convert_rgb (gint32 image_ID)
+gimp_image_convert_rgb (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -56,7 +56,7 @@ gimp_image_convert_rgb (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -77,7 +77,7 @@ gimp_image_convert_rgb (gint32 image_ID)
 
 /**
  * gimp_image_convert_grayscale:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Convert specified image to grayscale
  *
@@ -87,7 +87,7 @@ gimp_image_convert_rgb (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_convert_grayscale (gint32 image_ID)
+gimp_image_convert_grayscale (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -95,7 +95,7 @@ gimp_image_convert_grayscale (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -116,7 +116,7 @@ gimp_image_convert_grayscale (gint32 image_ID)
 
 /**
  * gimp_image_convert_indexed:
- * @image_ID: The image.
+ * @image: The image.
  * @dither_type: The dither type to use.
  * @palette_type: The type of palette to use.
  * @num_cols: The number of colors to quantize to, ignored unless (palette_type == 
GIMP_CONVERT_PALETTE_GENERATE).
@@ -143,7 +143,7 @@ gimp_image_convert_grayscale (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_convert_indexed (gint32                  image_ID,
+gimp_image_convert_indexed (GimpImage              *image,
                             GimpConvertDitherType   dither_type,
                             GimpConvertPaletteType  palette_type,
                             gint                    num_cols,
@@ -157,7 +157,7 @@ gimp_image_convert_indexed (gint32                  image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CONVERT_DITHER_TYPE, dither_type,
                                           GIMP_TYPE_CONVERT_PALETTE_TYPE, palette_type,
                                           GIMP_TYPE_INT32, num_cols,
@@ -235,7 +235,7 @@ gimp_image_convert_set_dither_matrix (gint          width,
 
 /**
  * gimp_image_convert_precision:
- * @image_ID: The image.
+ * @image: The image.
  * @precision: The new precision.
  *
  * Convert the image to the specified precision
@@ -249,8 +249,8 @@ gimp_image_convert_set_dither_matrix (gint          width,
  * Since: 2.10
  **/
 gboolean
-gimp_image_convert_precision (gint32        image_ID,
-                              GimpPrecision precision)
+gimp_image_convert_precision (GimpImage     *image,
+                              GimpPrecision  precision)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -258,7 +258,7 @@ gimp_image_convert_precision (gint32        image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_PRECISION, precision,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpimageconvert_pdb.h b/libgimp/gimpimageconvert_pdb.h
index 6bbcf0cb7a..fe4cfaf973 100644
--- a/libgimp/gimpimageconvert_pdb.h
+++ b/libgimp/gimpimageconvert_pdb.h
@@ -32,9 +32,9 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_image_convert_rgb               (gint32                  image_ID);
-gboolean gimp_image_convert_grayscale         (gint32                  image_ID);
-gboolean gimp_image_convert_indexed           (gint32                  image_ID,
+gboolean gimp_image_convert_rgb               (GimpImage              *image);
+gboolean gimp_image_convert_grayscale         (GimpImage              *image);
+gboolean gimp_image_convert_indexed           (GimpImage              *image,
                                                GimpConvertDitherType   dither_type,
                                                GimpConvertPaletteType  palette_type,
                                                gint                    num_cols,
@@ -45,7 +45,7 @@ gboolean gimp_image_convert_set_dither_matrix (gint                    width,
                                                gint                    height,
                                                gint                    matrix_length,
                                                const guint8           *matrix);
-gboolean gimp_image_convert_precision         (gint32                  image_ID,
+gboolean gimp_image_convert_precision         (GimpImage              *image,
                                                GimpPrecision           precision);
 
 
diff --git a/libgimp/gimpimagegrid_pdb.c b/libgimp/gimpimagegrid_pdb.c
index cea2447c18..e64ffa672c 100644
--- a/libgimp/gimpimagegrid_pdb.c
+++ b/libgimp/gimpimagegrid_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_grid_get_spacing:
- * @image_ID: The image.
+ * @image: The image.
  * @xspacing: (out): The image's grid horizontal spacing.
  * @yspacing: (out): The image's grid vertical spacing.
  *
@@ -50,9 +50,9 @@
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_get_spacing (gint32   image_ID,
-                             gdouble *xspacing,
-                             gdouble *yspacing)
+gimp_image_grid_get_spacing (GimpImage *image,
+                             gdouble   *xspacing,
+                             gdouble   *yspacing)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -60,7 +60,7 @@ gimp_image_grid_get_spacing (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -90,7 +90,7 @@ gimp_image_grid_get_spacing (gint32   image_ID,
 
 /**
  * gimp_image_grid_set_spacing:
- * @image_ID: The image.
+ * @image: The image.
  * @xspacing: The image's grid horizontal spacing.
  * @yspacing: The image's grid vertical spacing.
  *
@@ -104,9 +104,9 @@ gimp_image_grid_get_spacing (gint32   image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_set_spacing (gint32  image_ID,
-                             gdouble xspacing,
-                             gdouble yspacing)
+gimp_image_grid_set_spacing (GimpImage *image,
+                             gdouble    xspacing,
+                             gdouble    yspacing)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -114,7 +114,7 @@ gimp_image_grid_set_spacing (gint32  image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_DOUBLE, xspacing,
                                           G_TYPE_DOUBLE, yspacing,
                                           G_TYPE_NONE);
@@ -137,7 +137,7 @@ gimp_image_grid_set_spacing (gint32  image_ID,
 
 /**
  * gimp_image_grid_get_offset:
- * @image_ID: The image.
+ * @image: The image.
  * @xoffset: (out): The image's grid horizontal offset.
  * @yoffset: (out): The image's grid vertical offset.
  *
@@ -151,9 +151,9 @@ gimp_image_grid_set_spacing (gint32  image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_get_offset (gint32   image_ID,
-                            gdouble *xoffset,
-                            gdouble *yoffset)
+gimp_image_grid_get_offset (GimpImage *image,
+                            gdouble   *xoffset,
+                            gdouble   *yoffset)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -161,7 +161,7 @@ gimp_image_grid_get_offset (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -191,7 +191,7 @@ gimp_image_grid_get_offset (gint32   image_ID,
 
 /**
  * gimp_image_grid_set_offset:
- * @image_ID: The image.
+ * @image: The image.
  * @xoffset: The image's grid horizontal offset.
  * @yoffset: The image's grid vertical offset.
  *
@@ -205,9 +205,9 @@ gimp_image_grid_get_offset (gint32   image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_set_offset (gint32  image_ID,
-                            gdouble xoffset,
-                            gdouble yoffset)
+gimp_image_grid_set_offset (GimpImage *image,
+                            gdouble    xoffset,
+                            gdouble    yoffset)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -215,7 +215,7 @@ gimp_image_grid_set_offset (gint32  image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_DOUBLE, xoffset,
                                           G_TYPE_DOUBLE, yoffset,
                                           G_TYPE_NONE);
@@ -238,7 +238,7 @@ gimp_image_grid_set_offset (gint32  image_ID,
 
 /**
  * gimp_image_grid_get_foreground_color:
- * @image_ID: The image.
+ * @image: The image.
  * @fgcolor: (out caller-allocates): The image's grid foreground color.
  *
  * Sets the foreground color of an image's grid.
@@ -250,8 +250,8 @@ gimp_image_grid_set_offset (gint32  image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_get_foreground_color (gint32   image_ID,
-                                      GimpRGB *fgcolor)
+gimp_image_grid_get_foreground_color (GimpImage *image,
+                                      GimpRGB   *fgcolor)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -259,7 +259,7 @@ gimp_image_grid_get_foreground_color (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -283,7 +283,7 @@ gimp_image_grid_get_foreground_color (gint32   image_ID,
 
 /**
  * gimp_image_grid_set_foreground_color:
- * @image_ID: The image.
+ * @image: The image.
  * @fgcolor: The new foreground color.
  *
  * Gets the foreground color of an image's grid.
@@ -295,7 +295,7 @@ gimp_image_grid_get_foreground_color (gint32   image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_set_foreground_color (gint32         image_ID,
+gimp_image_grid_set_foreground_color (GimpImage     *image,
                                       const GimpRGB *fgcolor)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -304,7 +304,7 @@ gimp_image_grid_set_foreground_color (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_RGB, fgcolor,
                                           G_TYPE_NONE);
 
@@ -326,7 +326,7 @@ gimp_image_grid_set_foreground_color (gint32         image_ID,
 
 /**
  * gimp_image_grid_get_background_color:
- * @image_ID: The image.
+ * @image: The image.
  * @bgcolor: (out caller-allocates): The image's grid background color.
  *
  * Sets the background color of an image's grid.
@@ -338,8 +338,8 @@ gimp_image_grid_set_foreground_color (gint32         image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_get_background_color (gint32   image_ID,
-                                      GimpRGB *bgcolor)
+gimp_image_grid_get_background_color (GimpImage *image,
+                                      GimpRGB   *bgcolor)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -347,7 +347,7 @@ gimp_image_grid_get_background_color (gint32   image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -371,7 +371,7 @@ gimp_image_grid_get_background_color (gint32   image_ID,
 
 /**
  * gimp_image_grid_set_background_color:
- * @image_ID: The image.
+ * @image: The image.
  * @bgcolor: The new background color.
  *
  * Gets the background color of an image's grid.
@@ -383,7 +383,7 @@ gimp_image_grid_get_background_color (gint32   image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_set_background_color (gint32         image_ID,
+gimp_image_grid_set_background_color (GimpImage     *image,
                                       const GimpRGB *bgcolor)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -392,7 +392,7 @@ gimp_image_grid_set_background_color (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_RGB, bgcolor,
                                           G_TYPE_NONE);
 
@@ -414,7 +414,7 @@ gimp_image_grid_set_background_color (gint32         image_ID,
 
 /**
  * gimp_image_grid_get_style:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Gets the style of an image's grid.
  *
@@ -425,7 +425,7 @@ gimp_image_grid_set_background_color (gint32         image_ID,
  * Since: 2.4
  **/
 GimpGridStyle
-gimp_image_grid_get_style (gint32 image_ID)
+gimp_image_grid_get_style (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -433,7 +433,7 @@ gimp_image_grid_get_style (gint32 image_ID)
   GimpGridStyle style = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -455,7 +455,7 @@ gimp_image_grid_get_style (gint32 image_ID)
 
 /**
  * gimp_image_grid_set_style:
- * @image_ID: The image.
+ * @image: The image.
  * @style: The image's grid style.
  *
  * Sets the style unit of an image's grid.
@@ -468,8 +468,8 @@ gimp_image_grid_get_style (gint32 image_ID)
  * Since: 2.4
  **/
 gboolean
-gimp_image_grid_set_style (gint32        image_ID,
-                           GimpGridStyle style)
+gimp_image_grid_set_style (GimpImage     *image,
+                           GimpGridStyle  style)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -477,7 +477,7 @@ gimp_image_grid_set_style (gint32        image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_GRID_STYLE, style,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpimagegrid_pdb.h b/libgimp/gimpimagegrid_pdb.h
index f39a88af83..e256944329 100644
--- a/libgimp/gimpimagegrid_pdb.h
+++ b/libgimp/gimpimagegrid_pdb.h
@@ -32,28 +32,28 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean      gimp_image_grid_get_spacing          (gint32         image_ID,
+gboolean      gimp_image_grid_get_spacing          (GimpImage     *image,
                                                     gdouble       *xspacing,
                                                     gdouble       *yspacing);
-gboolean      gimp_image_grid_set_spacing          (gint32         image_ID,
+gboolean      gimp_image_grid_set_spacing          (GimpImage     *image,
                                                     gdouble        xspacing,
                                                     gdouble        yspacing);
-gboolean      gimp_image_grid_get_offset           (gint32         image_ID,
+gboolean      gimp_image_grid_get_offset           (GimpImage     *image,
                                                     gdouble       *xoffset,
                                                     gdouble       *yoffset);
-gboolean      gimp_image_grid_set_offset           (gint32         image_ID,
+gboolean      gimp_image_grid_set_offset           (GimpImage     *image,
                                                     gdouble        xoffset,
                                                     gdouble        yoffset);
-gboolean      gimp_image_grid_get_foreground_color (gint32         image_ID,
+gboolean      gimp_image_grid_get_foreground_color (GimpImage     *image,
                                                     GimpRGB       *fgcolor);
-gboolean      gimp_image_grid_set_foreground_color (gint32         image_ID,
+gboolean      gimp_image_grid_set_foreground_color (GimpImage     *image,
                                                     const GimpRGB *fgcolor);
-gboolean      gimp_image_grid_get_background_color (gint32         image_ID,
+gboolean      gimp_image_grid_get_background_color (GimpImage     *image,
                                                     GimpRGB       *bgcolor);
-gboolean      gimp_image_grid_set_background_color (gint32         image_ID,
+gboolean      gimp_image_grid_set_background_color (GimpImage     *image,
                                                     const GimpRGB *bgcolor);
-GimpGridStyle gimp_image_grid_get_style            (gint32         image_ID);
-gboolean      gimp_image_grid_set_style            (gint32         image_ID,
+GimpGridStyle gimp_image_grid_get_style            (GimpImage     *image);
+gboolean      gimp_image_grid_set_style            (GimpImage     *image,
                                                     GimpGridStyle  style);
 
 
diff --git a/libgimp/gimpimageguides_pdb.c b/libgimp/gimpimageguides_pdb.c
index 3fd2edfdd0..876af8cf22 100644
--- a/libgimp/gimpimageguides_pdb.c
+++ b/libgimp/gimpimageguides_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_add_hguide:
- * @image_ID: The image.
+ * @image: The image.
  * @yposition: The guide's y-offset from top of image.
  *
  * Add a horizontal guide to an image.
@@ -48,8 +48,8 @@
  * Returns: The new guide.
  **/
 gint32
-gimp_image_add_hguide (gint32 image_ID,
-                       gint   yposition)
+gimp_image_add_hguide (GimpImage *image,
+                       gint       yposition)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -57,7 +57,7 @@ gimp_image_add_hguide (gint32 image_ID,
   gint32 guide_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, yposition,
                                           G_TYPE_NONE);
 
@@ -80,7 +80,7 @@ gimp_image_add_hguide (gint32 image_ID,
 
 /**
  * gimp_image_add_vguide:
- * @image_ID: The image.
+ * @image: The image.
  * @xposition: The guide's x-offset from left of image.
  *
  * Add a vertical guide to an image.
@@ -92,8 +92,8 @@ gimp_image_add_hguide (gint32 image_ID,
  * Returns: The new guide.
  **/
 gint32
-gimp_image_add_vguide (gint32 image_ID,
-                       gint   xposition)
+gimp_image_add_vguide (GimpImage *image,
+                       gint       xposition)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -101,7 +101,7 @@ gimp_image_add_vguide (gint32 image_ID,
   gint32 guide_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, xposition,
                                           G_TYPE_NONE);
 
@@ -124,7 +124,7 @@ gimp_image_add_vguide (gint32 image_ID,
 
 /**
  * gimp_image_delete_guide:
- * @image_ID: The image.
+ * @image: The image.
  * @guide_ID: The ID of the guide to be removed.
  *
  * Deletes a guide from an image.
@@ -135,8 +135,8 @@ gimp_image_add_vguide (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_delete_guide (gint32 image_ID,
-                         gint32 guide_ID)
+gimp_image_delete_guide (GimpImage *image,
+                         gint32     guide_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -144,7 +144,7 @@ gimp_image_delete_guide (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, guide_ID,
                                           G_TYPE_NONE);
 
@@ -166,7 +166,7 @@ gimp_image_delete_guide (gint32 image_ID,
 
 /**
  * gimp_image_find_next_guide:
- * @image_ID: The image.
+ * @image: The image.
  * @guide_ID: The ID of the current guide (0 if first invocation).
  *
  * Find next guide on an image.
@@ -180,8 +180,8 @@ gimp_image_delete_guide (gint32 image_ID,
  * Returns: The next guide's ID.
  **/
 gint32
-gimp_image_find_next_guide (gint32 image_ID,
-                            gint32 guide_ID)
+gimp_image_find_next_guide (GimpImage *image,
+                            gint32     guide_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -189,7 +189,7 @@ gimp_image_find_next_guide (gint32 image_ID,
   gint32 next_guide_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, guide_ID,
                                           G_TYPE_NONE);
 
@@ -212,7 +212,7 @@ gimp_image_find_next_guide (gint32 image_ID,
 
 /**
  * gimp_image_get_guide_orientation:
- * @image_ID: The image.
+ * @image: The image.
  * @guide_ID: The guide.
  *
  * Get orientation of a guide on an image.
@@ -223,8 +223,8 @@ gimp_image_find_next_guide (gint32 image_ID,
  * Returns: The guide's orientation.
  **/
 GimpOrientationType
-gimp_image_get_guide_orientation (gint32 image_ID,
-                                  gint32 guide_ID)
+gimp_image_get_guide_orientation (GimpImage *image,
+                                  gint32     guide_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -232,7 +232,7 @@ gimp_image_get_guide_orientation (gint32 image_ID,
   GimpOrientationType orientation = GIMP_ORIENTATION_UNKNOWN;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, guide_ID,
                                           G_TYPE_NONE);
 
@@ -255,7 +255,7 @@ gimp_image_get_guide_orientation (gint32 image_ID,
 
 /**
  * gimp_image_get_guide_position:
- * @image_ID: The image.
+ * @image: The image.
  * @guide_ID: The guide.
  *
  * Get position of a guide on an image.
@@ -266,8 +266,8 @@ gimp_image_get_guide_orientation (gint32 image_ID,
  * Returns: The guide's position relative to top or left of image.
  **/
 gint
-gimp_image_get_guide_position (gint32 image_ID,
-                               gint32 guide_ID)
+gimp_image_get_guide_position (GimpImage *image,
+                               gint32     guide_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -275,7 +275,7 @@ gimp_image_get_guide_position (gint32 image_ID,
   gint position = G_MININT /* GIMP_GUIDE_POSITION_UNDEFINED */;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, guide_ID,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpimageguides_pdb.h b/libgimp/gimpimageguides_pdb.h
index 2f52ded872..6e69c4fdec 100644
--- a/libgimp/gimpimageguides_pdb.h
+++ b/libgimp/gimpimageguides_pdb.h
@@ -32,18 +32,18 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gint32              gimp_image_add_hguide            (gint32 image_ID,
-                                                      gint   yposition);
-gint32              gimp_image_add_vguide            (gint32 image_ID,
-                                                      gint   xposition);
-gboolean            gimp_image_delete_guide          (gint32 image_ID,
-                                                      gint32 guide_ID);
-gint32              gimp_image_find_next_guide       (gint32 image_ID,
-                                                      gint32 guide_ID);
-GimpOrientationType gimp_image_get_guide_orientation (gint32 image_ID,
-                                                      gint32 guide_ID);
-gint                gimp_image_get_guide_position    (gint32 image_ID,
-                                                      gint32 guide_ID);
+gint32              gimp_image_add_hguide            (GimpImage *image,
+                                                      gint       yposition);
+gint32              gimp_image_add_vguide            (GimpImage *image,
+                                                      gint       xposition);
+gboolean            gimp_image_delete_guide          (GimpImage *image,
+                                                      gint32     guide_ID);
+gint32              gimp_image_find_next_guide       (GimpImage *image,
+                                                      gint32     guide_ID);
+GimpOrientationType gimp_image_get_guide_orientation (GimpImage *image,
+                                                      gint32     guide_ID);
+gint                gimp_image_get_guide_position    (GimpImage *image,
+                                                      gint32     guide_ID);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpimagesamplepoints_pdb.c b/libgimp/gimpimagesamplepoints_pdb.c
index 68d1090b82..1949003726 100644
--- a/libgimp/gimpimagesamplepoints_pdb.c
+++ b/libgimp/gimpimagesamplepoints_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_add_sample_point:
- * @image_ID: The image.
+ * @image: The image.
  * @position_x: The guide'sample points x-offset from left of image.
  * @position_y: The guide'sample points y-offset from top of image.
  *
@@ -51,9 +51,9 @@
  * Since: 2.10
  **/
 gint32
-gimp_image_add_sample_point (gint32 image_ID,
-                             gint   position_x,
-                             gint   position_y)
+gimp_image_add_sample_point (GimpImage *image,
+                             gint       position_x,
+                             gint       position_y)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -61,7 +61,7 @@ gimp_image_add_sample_point (gint32 image_ID,
   gint32 sample_point_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, position_x,
                                           GIMP_TYPE_INT32, position_y,
                                           G_TYPE_NONE);
@@ -85,7 +85,7 @@ gimp_image_add_sample_point (gint32 image_ID,
 
 /**
  * gimp_image_delete_sample_point:
- * @image_ID: The image.
+ * @image: The image.
  * @sample_point_ID: The ID of the sample point to be removed.
  *
  * Deletes a sample point from an image.
@@ -98,8 +98,8 @@ gimp_image_add_sample_point (gint32 image_ID,
  * Since: 2.10
  **/
 gboolean
-gimp_image_delete_sample_point (gint32 image_ID,
-                                gint32 sample_point_ID)
+gimp_image_delete_sample_point (GimpImage *image,
+                                gint32     sample_point_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -107,7 +107,7 @@ gimp_image_delete_sample_point (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, sample_point_ID,
                                           G_TYPE_NONE);
 
@@ -129,7 +129,7 @@ gimp_image_delete_sample_point (gint32 image_ID,
 
 /**
  * gimp_image_find_next_sample_point:
- * @image_ID: The image.
+ * @image: The image.
  * @sample_point_ID: The ID of the current sample point (0 if first invocation).
  *
  * Find next sample point on an image.
@@ -146,8 +146,8 @@ gimp_image_delete_sample_point (gint32 image_ID,
  * Since: 2.10
  **/
 gint32
-gimp_image_find_next_sample_point (gint32 image_ID,
-                                   gint32 sample_point_ID)
+gimp_image_find_next_sample_point (GimpImage *image,
+                                   gint32     sample_point_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -155,7 +155,7 @@ gimp_image_find_next_sample_point (gint32 image_ID,
   gint32 next_sample_point_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, sample_point_ID,
                                           G_TYPE_NONE);
 
@@ -178,7 +178,7 @@ gimp_image_find_next_sample_point (gint32 image_ID,
 
 /**
  * gimp_image_get_sample_point_position:
- * @image_ID: The image.
+ * @image: The image.
  * @sample_point_ID: The guide.
  * @position_y: (out): The sample points's position relative to top of image.
  *
@@ -193,9 +193,9 @@ gimp_image_find_next_sample_point (gint32 image_ID,
  * Since: 2.10
  **/
 gint
-gimp_image_get_sample_point_position (gint32  image_ID,
-                                      gint32  sample_point_ID,
-                                      gint   *position_y)
+gimp_image_get_sample_point_position (GimpImage *image,
+                                      gint32     sample_point_ID,
+                                      gint      *position_y)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -203,7 +203,7 @@ gimp_image_get_sample_point_position (gint32  image_ID,
   gint position_x = G_MININT;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, sample_point_ID,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpimagesamplepoints_pdb.h b/libgimp/gimpimagesamplepoints_pdb.h
index a1daa698a2..feb7b20bd9 100644
--- a/libgimp/gimpimagesamplepoints_pdb.h
+++ b/libgimp/gimpimagesamplepoints_pdb.h
@@ -32,16 +32,16 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gint32   gimp_image_add_sample_point          (gint32  image_ID,
-                                               gint    position_x,
-                                               gint    position_y);
-gboolean gimp_image_delete_sample_point       (gint32  image_ID,
-                                               gint32  sample_point_ID);
-gint32   gimp_image_find_next_sample_point    (gint32  image_ID,
-                                               gint32  sample_point_ID);
-gint     gimp_image_get_sample_point_position (gint32  image_ID,
-                                               gint32  sample_point_ID,
-                                               gint   *position_y);
+gint32   gimp_image_add_sample_point          (GimpImage *image,
+                                               gint       position_x,
+                                               gint       position_y);
+gboolean gimp_image_delete_sample_point       (GimpImage *image,
+                                               gint32     sample_point_ID);
+gint32   gimp_image_find_next_sample_point    (GimpImage *image,
+                                               gint32     sample_point_ID);
+gint     gimp_image_get_sample_point_position (GimpImage *image,
+                                               gint32     sample_point_ID,
+                                               gint      *position_y);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpimageselect_pdb.c b/libgimp/gimpimageselect_pdb.c
index 674c833658..2fc168b466 100644
--- a/libgimp/gimpimageselect_pdb.c
+++ b/libgimp/gimpimageselect_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_select_color:
- * @image_ID: The affected image.
+ * @image: The affected image.
  * @operation: The selection operation.
  * @drawable_ID: The affected drawable.
  * @color: The color to select.
@@ -66,7 +66,7 @@
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_color (gint32          image_ID,
+gimp_image_select_color (GimpImage      *image,
                          GimpChannelOps  operation,
                          gint32          drawable_ID,
                          const GimpRGB  *color)
@@ -77,7 +77,7 @@ gimp_image_select_color (gint32          image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           GIMP_TYPE_DRAWABLE_ID, drawable_ID,
                                           GIMP_TYPE_RGB, color,
@@ -101,7 +101,7 @@ gimp_image_select_color (gint32          image_ID,
 
 /**
  * gimp_image_select_contiguous_color:
- * @image_ID: The affected image.
+ * @image: The affected image.
  * @operation: The selection operation.
  * @drawable_ID: The affected drawable.
  * @x: x coordinate of initial seed fill point: (image coordinates).
@@ -141,11 +141,11 @@ gimp_image_select_color (gint32          image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_contiguous_color (gint32         image_ID,
-                                    GimpChannelOps operation,
-                                    gint32         drawable_ID,
-                                    gdouble        x,
-                                    gdouble        y)
+gimp_image_select_contiguous_color (GimpImage      *image,
+                                    GimpChannelOps  operation,
+                                    gint32          drawable_ID,
+                                    gdouble         x,
+                                    gdouble         y)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -153,7 +153,7 @@ gimp_image_select_contiguous_color (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           GIMP_TYPE_DRAWABLE_ID, drawable_ID,
                                           G_TYPE_DOUBLE, x,
@@ -178,7 +178,7 @@ gimp_image_select_contiguous_color (gint32         image_ID,
 
 /**
  * gimp_image_select_rectangle:
- * @image_ID: The image.
+ * @image: The image.
  * @operation: The selection operation.
  * @x: x coordinate of upper-left corner of rectangle.
  * @y: y coordinate of upper-left corner of rectangle.
@@ -199,12 +199,12 @@ gimp_image_select_contiguous_color (gint32         image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_rectangle (gint32         image_ID,
-                             GimpChannelOps operation,
-                             gdouble        x,
-                             gdouble        y,
-                             gdouble        width,
-                             gdouble        height)
+gimp_image_select_rectangle (GimpImage      *image,
+                             GimpChannelOps  operation,
+                             gdouble         x,
+                             gdouble         y,
+                             gdouble         width,
+                             gdouble         height)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -212,7 +212,7 @@ gimp_image_select_rectangle (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           G_TYPE_DOUBLE, x,
                                           G_TYPE_DOUBLE, y,
@@ -238,7 +238,7 @@ gimp_image_select_rectangle (gint32         image_ID,
 
 /**
  * gimp_image_select_round_rectangle:
- * @image_ID: The image.
+ * @image: The image.
  * @operation: The selection operation.
  * @x: x coordinate of upper-left corner of rectangle.
  * @y: y coordinate of upper-left corner of rectangle.
@@ -264,14 +264,14 @@ gimp_image_select_rectangle (gint32         image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_round_rectangle (gint32         image_ID,
-                                   GimpChannelOps operation,
-                                   gdouble        x,
-                                   gdouble        y,
-                                   gdouble        width,
-                                   gdouble        height,
-                                   gdouble        corner_radius_x,
-                                   gdouble        corner_radius_y)
+gimp_image_select_round_rectangle (GimpImage      *image,
+                                   GimpChannelOps  operation,
+                                   gdouble         x,
+                                   gdouble         y,
+                                   gdouble         width,
+                                   gdouble         height,
+                                   gdouble         corner_radius_x,
+                                   gdouble         corner_radius_y)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -279,7 +279,7 @@ gimp_image_select_round_rectangle (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           G_TYPE_DOUBLE, x,
                                           G_TYPE_DOUBLE, y,
@@ -307,7 +307,7 @@ gimp_image_select_round_rectangle (gint32         image_ID,
 
 /**
  * gimp_image_select_ellipse:
- * @image_ID: The image.
+ * @image: The image.
  * @operation: The selection operation.
  * @x: x coordinate of upper-left corner of ellipse bounding box.
  * @y: y coordinate of upper-left corner of ellipse bounding box.
@@ -329,12 +329,12 @@ gimp_image_select_round_rectangle (gint32         image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_ellipse (gint32         image_ID,
-                           GimpChannelOps operation,
-                           gdouble        x,
-                           gdouble        y,
-                           gdouble        width,
-                           gdouble        height)
+gimp_image_select_ellipse (GimpImage      *image,
+                           GimpChannelOps  operation,
+                           gdouble         x,
+                           gdouble         y,
+                           gdouble         width,
+                           gdouble         height)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -342,7 +342,7 @@ gimp_image_select_ellipse (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           G_TYPE_DOUBLE, x,
                                           G_TYPE_DOUBLE, y,
@@ -368,7 +368,7 @@ gimp_image_select_ellipse (gint32         image_ID,
 
 /**
  * gimp_image_select_polygon:
- * @image_ID: The image.
+ * @image: The image.
  * @operation: The selection operation.
  * @num_segs: Number of points (count 1 coordinate as two points).
  * @segs: (array length=num_segs) (element-type gdouble): Array of points: { p1.x, p1.y, p2.x, p2.y, ..., 
pn.x, pn.y}.
@@ -393,7 +393,7 @@ gimp_image_select_ellipse (gint32         image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_polygon (gint32          image_ID,
+gimp_image_select_polygon (GimpImage      *image,
                            GimpChannelOps  operation,
                            gint            num_segs,
                            const gdouble  *segs)
@@ -404,7 +404,7 @@ gimp_image_select_polygon (gint32          image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           GIMP_TYPE_INT32, num_segs,
                                           GIMP_TYPE_FLOAT_ARRAY, NULL,
@@ -429,7 +429,7 @@ gimp_image_select_polygon (gint32          image_ID,
 
 /**
  * gimp_image_select_item:
- * @image_ID: The image.
+ * @image: The image.
  * @operation: The desired operation with current selection.
  * @item_ID: The item to render to the selection.
  *
@@ -449,9 +449,9 @@ gimp_image_select_polygon (gint32          image_ID,
  * Since: 2.8
  **/
 gboolean
-gimp_image_select_item (gint32         image_ID,
-                        GimpChannelOps operation,
-                        gint32         item_ID)
+gimp_image_select_item (GimpImage      *image,
+                        GimpChannelOps  operation,
+                        gint32          item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -459,7 +459,7 @@ gimp_image_select_item (gint32         image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_CHANNEL_OPS, operation,
                                           GIMP_TYPE_ITEM_ID, item_ID,
                                           G_TYPE_NONE);
diff --git a/libgimp/gimpimageselect_pdb.h b/libgimp/gimpimageselect_pdb.h
index a7e5db8598..9918092421 100644
--- a/libgimp/gimpimageselect_pdb.h
+++ b/libgimp/gimpimageselect_pdb.h
@@ -32,22 +32,22 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_image_select_color            (gint32          image_ID,
+gboolean gimp_image_select_color            (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gint32          drawable_ID,
                                              const GimpRGB  *color);
-gboolean gimp_image_select_contiguous_color (gint32          image_ID,
+gboolean gimp_image_select_contiguous_color (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gint32          drawable_ID,
                                              gdouble         x,
                                              gdouble         y);
-gboolean gimp_image_select_rectangle        (gint32          image_ID,
+gboolean gimp_image_select_rectangle        (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gdouble         x,
                                              gdouble         y,
                                              gdouble         width,
                                              gdouble         height);
-gboolean gimp_image_select_round_rectangle  (gint32          image_ID,
+gboolean gimp_image_select_round_rectangle  (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gdouble         x,
                                              gdouble         y,
@@ -55,17 +55,17 @@ gboolean gimp_image_select_round_rectangle  (gint32          image_ID,
                                              gdouble         height,
                                              gdouble         corner_radius_x,
                                              gdouble         corner_radius_y);
-gboolean gimp_image_select_ellipse          (gint32          image_ID,
+gboolean gimp_image_select_ellipse          (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gdouble         x,
                                              gdouble         y,
                                              gdouble         width,
                                              gdouble         height);
-gboolean gimp_image_select_polygon          (gint32          image_ID,
+gboolean gimp_image_select_polygon          (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gint            num_segs,
                                              const gdouble  *segs);
-gboolean gimp_image_select_item             (gint32          image_ID,
+gboolean gimp_image_select_item             (GimpImage      *image,
                                              GimpChannelOps  operation,
                                              gint32          item_ID);
 
diff --git a/libgimp/gimpimagetransform_pdb.c b/libgimp/gimpimagetransform_pdb.c
index d1133148bd..7fe8b466f6 100644
--- a/libgimp/gimpimagetransform_pdb.c
+++ b/libgimp/gimpimagetransform_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_resize:
- * @image_ID: The image.
+ * @image: The image.
  * @new_width: New image width.
  * @new_height: New image height.
  * @offx: x offset between upper left corner of old and new images: (new - old).
@@ -55,11 +55,11 @@
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_resize (gint32 image_ID,
-                   gint   new_width,
-                   gint   new_height,
-                   gint   offx,
-                   gint   offy)
+gimp_image_resize (GimpImage *image,
+                   gint       new_width,
+                   gint       new_height,
+                   gint       offx,
+                   gint       offy)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -67,7 +67,7 @@ gimp_image_resize (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, new_width,
                                           GIMP_TYPE_INT32, new_height,
                                           GIMP_TYPE_INT32, offx,
@@ -92,7 +92,7 @@ gimp_image_resize (gint32 image_ID,
 
 /**
  * gimp_image_resize_to_layers:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Resize the image to fit all layers.
  *
@@ -106,7 +106,7 @@ gimp_image_resize (gint32 image_ID,
  * Since: 2.2
  **/
 gboolean
-gimp_image_resize_to_layers (gint32 image_ID)
+gimp_image_resize_to_layers (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -114,7 +114,7 @@ gimp_image_resize_to_layers (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -135,7 +135,7 @@ gimp_image_resize_to_layers (gint32 image_ID)
 
 /**
  * gimp_image_scale:
- * @image_ID: The image.
+ * @image: The image.
  * @new_width: New image width.
  * @new_height: New image height.
  *
@@ -150,9 +150,9 @@ gimp_image_resize_to_layers (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_scale (gint32 image_ID,
-                  gint   new_width,
-                  gint   new_height)
+gimp_image_scale (GimpImage *image,
+                  gint       new_width,
+                  gint       new_height)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -160,7 +160,7 @@ gimp_image_scale (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, new_width,
                                           GIMP_TYPE_INT32, new_height,
                                           G_TYPE_NONE);
@@ -183,7 +183,7 @@ gimp_image_scale (gint32 image_ID,
 
 /**
  * gimp_image_crop:
- * @image_ID: The image.
+ * @image: The image.
  * @new_width: New image width: (0 < new_width <= width).
  * @new_height: New image height: (0 < new_height <= height).
  * @offx: X offset: (0 <= offx <= (width - new_width)).
@@ -201,11 +201,11 @@ gimp_image_scale (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_crop (gint32 image_ID,
-                 gint   new_width,
-                 gint   new_height,
-                 gint   offx,
-                 gint   offy)
+gimp_image_crop (GimpImage *image,
+                 gint       new_width,
+                 gint       new_height,
+                 gint       offx,
+                 gint       offy)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -213,7 +213,7 @@ gimp_image_crop (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, new_width,
                                           GIMP_TYPE_INT32, new_height,
                                           GIMP_TYPE_INT32, offx,
@@ -238,7 +238,7 @@ gimp_image_crop (gint32 image_ID,
 
 /**
  * gimp_image_flip:
- * @image_ID: The image.
+ * @image: The image.
  * @flip_type: Type of flip.
  *
  * Flips the image horizontally or vertically.
@@ -248,8 +248,8 @@ gimp_image_crop (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_flip (gint32              image_ID,
-                 GimpOrientationType flip_type)
+gimp_image_flip (GimpImage           *image,
+                 GimpOrientationType  flip_type)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -257,7 +257,7 @@ gimp_image_flip (gint32              image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ORIENTATION_TYPE, flip_type,
                                           G_TYPE_NONE);
 
@@ -279,7 +279,7 @@ gimp_image_flip (gint32              image_ID,
 
 /**
  * gimp_image_rotate:
- * @image_ID: The image.
+ * @image: The image.
  * @rotate_type: Angle of rotation.
  *
  * Rotates the image by the specified degrees.
@@ -289,8 +289,8 @@ gimp_image_flip (gint32              image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_rotate (gint32           image_ID,
-                   GimpRotationType rotate_type)
+gimp_image_rotate (GimpImage        *image,
+                   GimpRotationType  rotate_type)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -298,7 +298,7 @@ gimp_image_rotate (gint32           image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_ROTATION_TYPE, rotate_type,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpimagetransform_pdb.h b/libgimp/gimpimagetransform_pdb.h
index c63e7192e6..f82c018682 100644
--- a/libgimp/gimpimagetransform_pdb.h
+++ b/libgimp/gimpimagetransform_pdb.h
@@ -32,24 +32,24 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_image_resize           (gint32              image_ID,
-                                      gint                new_width,
-                                      gint                new_height,
-                                      gint                offx,
-                                      gint                offy);
-gboolean gimp_image_resize_to_layers (gint32              image_ID);
-gboolean gimp_image_scale            (gint32              image_ID,
-                                      gint                new_width,
-                                      gint                new_height);
-gboolean gimp_image_crop             (gint32              image_ID,
-                                      gint                new_width,
-                                      gint                new_height,
-                                      gint                offx,
-                                      gint                offy);
-gboolean gimp_image_flip             (gint32              image_ID,
-                                      GimpOrientationType flip_type);
-gboolean gimp_image_rotate           (gint32              image_ID,
-                                      GimpRotationType    rotate_type);
+gboolean gimp_image_resize           (GimpImage           *image,
+                                      gint                 new_width,
+                                      gint                 new_height,
+                                      gint                 offx,
+                                      gint                 offy);
+gboolean gimp_image_resize_to_layers (GimpImage           *image);
+gboolean gimp_image_scale            (GimpImage           *image,
+                                      gint                 new_width,
+                                      gint                 new_height);
+gboolean gimp_image_crop             (GimpImage           *image,
+                                      gint                 new_width,
+                                      gint                 new_height,
+                                      gint                 offx,
+                                      gint                 offy);
+gboolean gimp_image_flip             (GimpImage           *image,
+                                      GimpOrientationType  flip_type);
+gboolean gimp_image_rotate           (GimpImage           *image,
+                                      GimpRotationType     rotate_type);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpimageundo_pdb.c b/libgimp/gimpimageundo_pdb.c
index 36fc6db96c..0cf0465c62 100644
--- a/libgimp/gimpimageundo_pdb.c
+++ b/libgimp/gimpimageundo_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_image_undo_group_start:
- * @image_ID: The ID of the image in which to open an undo group.
+ * @image: The ID of the image in which to open an undo group.
  *
  * Starts a group undo.
  *
@@ -48,7 +48,7 @@
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_undo_group_start (gint32 image_ID)
+gimp_image_undo_group_start (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -56,7 +56,7 @@ gimp_image_undo_group_start (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -77,7 +77,7 @@ gimp_image_undo_group_start (gint32 image_ID)
 
 /**
  * gimp_image_undo_group_end:
- * @image_ID: The ID of the image in which to close an undo group.
+ * @image: The ID of the image in which to close an undo group.
  *
  * Finish a group undo.
  *
@@ -87,7 +87,7 @@ gimp_image_undo_group_start (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_image_undo_group_end (gint32 image_ID)
+gimp_image_undo_group_end (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -95,7 +95,7 @@ gimp_image_undo_group_end (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -116,7 +116,7 @@ gimp_image_undo_group_end (gint32 image_ID)
 
 /**
  * gimp_image_undo_is_enabled:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Check if the image's undo stack is enabled.
  *
@@ -128,7 +128,7 @@ gimp_image_undo_group_end (gint32 image_ID)
  * Returns: TRUE if undo is enabled for this image.
  **/
 gboolean
-gimp_image_undo_is_enabled (gint32 image_ID)
+gimp_image_undo_is_enabled (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -136,7 +136,7 @@ gimp_image_undo_is_enabled (gint32 image_ID)
   gboolean enabled = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -158,7 +158,7 @@ gimp_image_undo_is_enabled (gint32 image_ID)
 
 /**
  * gimp_image_undo_disable:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Disable the image's undo stack.
  *
@@ -171,7 +171,7 @@ gimp_image_undo_is_enabled (gint32 image_ID)
  * Returns: TRUE if the image undo has been disabled.
  **/
 gboolean
-gimp_image_undo_disable (gint32 image_ID)
+gimp_image_undo_disable (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -179,7 +179,7 @@ gimp_image_undo_disable (gint32 image_ID)
   gboolean disabled = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -201,7 +201,7 @@ gimp_image_undo_disable (gint32 image_ID)
 
 /**
  * gimp_image_undo_enable:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Enable the image's undo stack.
  *
@@ -213,7 +213,7 @@ gimp_image_undo_disable (gint32 image_ID)
  * Returns: TRUE if the image undo has been enabled.
  **/
 gboolean
-gimp_image_undo_enable (gint32 image_ID)
+gimp_image_undo_enable (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -221,7 +221,7 @@ gimp_image_undo_enable (gint32 image_ID)
   gboolean enabled = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -243,7 +243,7 @@ gimp_image_undo_enable (gint32 image_ID)
 
 /**
  * gimp_image_undo_freeze:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Freeze the image's undo stack.
  *
@@ -262,7 +262,7 @@ gimp_image_undo_enable (gint32 image_ID)
  * Returns: TRUE if the image undo has been frozen.
  **/
 gboolean
-gimp_image_undo_freeze (gint32 image_ID)
+gimp_image_undo_freeze (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -270,7 +270,7 @@ gimp_image_undo_freeze (gint32 image_ID)
   gboolean frozen = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -292,7 +292,7 @@ gimp_image_undo_freeze (gint32 image_ID)
 
 /**
  * gimp_image_undo_thaw:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Thaw the image's undo stack.
  *
@@ -310,7 +310,7 @@ gimp_image_undo_freeze (gint32 image_ID)
  * Returns: TRUE if the image undo has been thawed.
  **/
 gboolean
-gimp_image_undo_thaw (gint32 image_ID)
+gimp_image_undo_thaw (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -318,7 +318,7 @@ gimp_image_undo_thaw (gint32 image_ID)
   gboolean thawed = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
diff --git a/libgimp/gimpimageundo_pdb.h b/libgimp/gimpimageundo_pdb.h
index fc2bf5e9e3..3caa0f2227 100644
--- a/libgimp/gimpimageundo_pdb.h
+++ b/libgimp/gimpimageundo_pdb.h
@@ -32,13 +32,13 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean gimp_image_undo_group_start (gint32 image_ID);
-gboolean gimp_image_undo_group_end   (gint32 image_ID);
-gboolean gimp_image_undo_is_enabled  (gint32 image_ID);
-gboolean gimp_image_undo_disable     (gint32 image_ID);
-gboolean gimp_image_undo_enable      (gint32 image_ID);
-gboolean gimp_image_undo_freeze      (gint32 image_ID);
-gboolean gimp_image_undo_thaw        (gint32 image_ID);
+gboolean gimp_image_undo_group_start (GimpImage *image);
+gboolean gimp_image_undo_group_end   (GimpImage *image);
+gboolean gimp_image_undo_is_enabled  (GimpImage *image);
+gboolean gimp_image_undo_disable     (GimpImage *image);
+gboolean gimp_image_undo_enable      (GimpImage *image);
+gboolean gimp_image_undo_freeze      (GimpImage *image);
+gboolean gimp_image_undo_thaw        (GimpImage *image);
 
 
 G_END_DECLS
diff --git a/libgimp/gimpitem_pdb.c b/libgimp/gimpitem_pdb.c
index 5f5f0b4641..4b20593f03 100644
--- a/libgimp/gimpitem_pdb.c
+++ b/libgimp/gimpitem_pdb.c
@@ -84,17 +84,17 @@ gimp_item_is_valid (gint32 item_ID)
  *
  * This procedure returns the item's image.
  *
- * Returns: The item's image.
+ * Returns: (transfer full): The item's image.
  *
  * Since: 2.8
  **/
-gint32
+GimpImage *
 gimp_item_get_image (gint32 item_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
   GimpValueArray *return_vals;
-  gint32 image_ID = -1;
+  GimpImage *image = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_ITEM_ID, item_ID,
@@ -110,11 +110,11 @@ gimp_item_get_image (gint32 item_ID)
   gimp_value_array_unref (args);
 
   if (g_value_get_enum (gimp_value_array_index (return_vals, 0)) == GIMP_PDB_SUCCESS)
-    image_ID = gimp_value_get_image_id (gimp_value_array_index (return_vals, 1));
+    image = g_object_new (GIMP_TYPE_IMAGE, "id", gimp_value_array_index (return_vals, 1), NULL);
 
   gimp_value_array_unref (return_vals);
 
-  return image_ID;
+  return image;
 }
 
 /**
diff --git a/libgimp/gimpitem_pdb.h b/libgimp/gimpitem_pdb.h
index f9c21587bd..6b916c925c 100644
--- a/libgimp/gimpitem_pdb.h
+++ b/libgimp/gimpitem_pdb.h
@@ -33,7 +33,7 @@ G_BEGIN_DECLS
 
 
 gboolean      gimp_item_is_valid          (gint32              item_ID);
-gint32        gimp_item_get_image         (gint32              item_ID);
+GimpImage*    gimp_item_get_image         (gint32              item_ID);
 gboolean      gimp_item_delete            (gint32              item_ID);
 gboolean      gimp_item_is_drawable       (gint32              item_ID);
 gboolean      gimp_item_is_layer          (gint32              item_ID);
diff --git a/libgimp/gimplayer_pdb.c b/libgimp/gimplayer_pdb.c
index 84aefecfda..fe295c6ca2 100644
--- a/libgimp/gimplayer_pdb.c
+++ b/libgimp/gimplayer_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * _gimp_layer_new:
- * @image_ID: The image to which to add the layer.
+ * @image: The image to which to add the layer.
  * @width: The layer width.
  * @height: The layer height.
  * @type: The layer type.
@@ -56,7 +56,7 @@
  * Returns: The newly created layer.
  **/
 gint32
-_gimp_layer_new (gint32         image_ID,
+_gimp_layer_new (GimpImage     *image,
                  gint           width,
                  gint           height,
                  GimpImageType  type,
@@ -70,7 +70,7 @@ _gimp_layer_new (gint32         image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, width,
                                           GIMP_TYPE_INT32, height,
                                           GIMP_TYPE_IMAGE_TYPE, type,
@@ -98,8 +98,8 @@ _gimp_layer_new (gint32         image_ID,
 
 /**
  * gimp_layer_new_from_visible:
- * @image_ID: The source image from where the content is copied.
- * @dest_image_ID: The destination image to which to add the layer.
+ * @image: The source image from where the content is copied.
+ * @dest_image: The destination image to which to add the layer.
  * @name: The layer name.
  *
  * Create a new layer from what is visible in an image.
@@ -115,8 +115,8 @@ _gimp_layer_new (gint32         image_ID,
  * Since: 2.6
  **/
 gint32
-gimp_layer_new_from_visible (gint32       image_ID,
-                             gint32       dest_image_ID,
+gimp_layer_new_from_visible (GimpImage   *image,
+                             GimpImage   *dest_image,
                              const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -125,8 +125,8 @@ gimp_layer_new_from_visible (gint32       image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
-                                          GIMP_TYPE_IMAGE_ID, dest_image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (dest_image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -150,7 +150,7 @@ gimp_layer_new_from_visible (gint32       image_ID,
 /**
  * gimp_layer_new_from_drawable:
  * @drawable_ID: The source drawable from where the new layer is copied.
- * @dest_image_ID: The destination image to which to add the layer.
+ * @dest_image: The destination image to which to add the layer.
  *
  * Create a new layer by copying an existing drawable.
  *
@@ -163,8 +163,8 @@ gimp_layer_new_from_visible (gint32       image_ID,
  * Returns: The newly copied layer.
  **/
 gint32
-gimp_layer_new_from_drawable (gint32 drawable_ID,
-                              gint32 dest_image_ID)
+gimp_layer_new_from_drawable (gint32     drawable_ID,
+                              GimpImage *dest_image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -173,7 +173,7 @@ gimp_layer_new_from_drawable (gint32 drawable_ID,
 
   args = gimp_value_array_new_from_types (NULL,
                                           GIMP_TYPE_DRAWABLE_ID, drawable_ID,
-                                          GIMP_TYPE_IMAGE_ID, dest_image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (dest_image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -195,7 +195,7 @@ gimp_layer_new_from_drawable (gint32 drawable_ID,
 
 /**
  * gimp_layer_group_new:
- * @image_ID: The image to which to add the layer group.
+ * @image: The image to which to add the layer group.
  *
  * Create a new layer group.
  *
@@ -212,7 +212,7 @@ gimp_layer_new_from_drawable (gint32 drawable_ID,
  * Since: 2.8
  **/
 gint32
-gimp_layer_group_new (gint32 image_ID)
+gimp_layer_group_new (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -220,7 +220,7 @@ gimp_layer_group_new (gint32 image_ID)
   gint32 layer_group_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
diff --git a/libgimp/gimplayer_pdb.h b/libgimp/gimplayer_pdb.h
index 41267a8bbb..b46c48dac5 100644
--- a/libgimp/gimplayer_pdb.h
+++ b/libgimp/gimplayer_pdb.h
@@ -32,19 +32,19 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-G_GNUC_INTERNAL gint32 _gimp_layer_new                 (gint32                  image_ID,
+G_GNUC_INTERNAL gint32 _gimp_layer_new                 (GimpImage              *image,
                                                         gint                    width,
                                                         gint                    height,
                                                         GimpImageType           type,
                                                         const gchar            *name,
                                                         gdouble                 opacity,
                                                         GimpLayerMode           mode);
-gint32                 gimp_layer_new_from_visible     (gint32                  image_ID,
-                                                        gint32                  dest_image_ID,
+gint32                 gimp_layer_new_from_visible     (GimpImage              *image,
+                                                        GimpImage              *dest_image,
                                                         const gchar            *name);
 gint32                 gimp_layer_new_from_drawable    (gint32                  drawable_ID,
-                                                        gint32                  dest_image_ID);
-gint32                 gimp_layer_group_new            (gint32                  image_ID);
+                                                        GimpImage              *dest_image);
+gint32                 gimp_layer_group_new            (GimpImage              *image);
 G_GNUC_INTERNAL gint32 _gimp_layer_copy                (gint32                  layer_ID,
                                                         gboolean                add_alpha);
 gboolean               gimp_layer_add_alpha            (gint32                  layer_ID);
diff --git a/libgimp/gimpselection_pdb.c b/libgimp/gimpselection_pdb.c
index 4124561b4f..48c5157488 100644
--- a/libgimp/gimpselection_pdb.c
+++ b/libgimp/gimpselection_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_selection_bounds:
- * @image_ID: The image.
+ * @image: The image.
  * @non_empty: (out): TRUE if there is a selection.
  * @x1: (out): x coordinate of upper left corner of selection bounds.
  * @y1: (out): y coordinate of upper left corner of selection bounds.
@@ -57,12 +57,12 @@
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_bounds (gint32    image_ID,
-                       gboolean *non_empty,
-                       gint     *x1,
-                       gint     *y1,
-                       gint     *x2,
-                       gint     *y2)
+gimp_selection_bounds (GimpImage *image,
+                       gboolean  *non_empty,
+                       gint      *x1,
+                       gint      *y1,
+                       gint      *x2,
+                       gint      *y2)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -70,7 +70,7 @@ gimp_selection_bounds (gint32    image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -106,7 +106,7 @@ gimp_selection_bounds (gint32    image_ID,
 
 /**
  * gimp_selection_value:
- * @image_ID: The image.
+ * @image: The image.
  * @x: x coordinate of value.
  * @y: y coordinate of value.
  *
@@ -118,9 +118,9 @@ gimp_selection_bounds (gint32    image_ID,
  * Returns: Value of the selection.
  **/
 gint
-gimp_selection_value (gint32 image_ID,
-                      gint   x,
-                      gint   y)
+gimp_selection_value (GimpImage *image,
+                      gint       x,
+                      gint       y)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -128,7 +128,7 @@ gimp_selection_value (gint32 image_ID,
   gint value = 0;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, x,
                                           GIMP_TYPE_INT32, y,
                                           G_TYPE_NONE);
@@ -152,7 +152,7 @@ gimp_selection_value (gint32 image_ID,
 
 /**
  * gimp_selection_is_empty:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Determine whether the selection is empty.
  *
@@ -162,7 +162,7 @@ gimp_selection_value (gint32 image_ID,
  * Returns: Is the selection empty?
  **/
 gboolean
-gimp_selection_is_empty (gint32 image_ID)
+gimp_selection_is_empty (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -170,7 +170,7 @@ gimp_selection_is_empty (gint32 image_ID)
   gboolean is_empty = FALSE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -192,7 +192,7 @@ gimp_selection_is_empty (gint32 image_ID)
 
 /**
  * gimp_selection_translate:
- * @image_ID: The image.
+ * @image: The image.
  * @offx: x offset for translation.
  * @offy: y offset for translation.
  *
@@ -207,9 +207,9 @@ gimp_selection_is_empty (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_translate (gint32 image_ID,
-                          gint   offx,
-                          gint   offy)
+gimp_selection_translate (GimpImage *image,
+                          gint       offx,
+                          gint       offy)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -217,7 +217,7 @@ gimp_selection_translate (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, offx,
                                           GIMP_TYPE_INT32, offy,
                                           G_TYPE_NONE);
@@ -290,7 +290,7 @@ _gimp_selection_float (gint32 drawable_ID,
 
 /**
  * gimp_selection_invert:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Invert the selection mask.
  *
@@ -300,7 +300,7 @@ _gimp_selection_float (gint32 drawable_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_invert (gint32 image_ID)
+gimp_selection_invert (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -308,7 +308,7 @@ gimp_selection_invert (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -329,7 +329,7 @@ gimp_selection_invert (gint32 image_ID)
 
 /**
  * gimp_selection_sharpen:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Sharpen the selection mask.
  *
@@ -341,7 +341,7 @@ gimp_selection_invert (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_sharpen (gint32 image_ID)
+gimp_selection_sharpen (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -349,7 +349,7 @@ gimp_selection_sharpen (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -370,7 +370,7 @@ gimp_selection_sharpen (gint32 image_ID)
 
 /**
  * gimp_selection_all:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Select all of the image.
  *
@@ -380,7 +380,7 @@ gimp_selection_sharpen (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_all (gint32 image_ID)
+gimp_selection_all (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -388,7 +388,7 @@ gimp_selection_all (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -409,7 +409,7 @@ gimp_selection_all (gint32 image_ID)
 
 /**
  * gimp_selection_none:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Deselect the entire image.
  *
@@ -419,7 +419,7 @@ gimp_selection_all (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_none (gint32 image_ID)
+gimp_selection_none (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -427,7 +427,7 @@ gimp_selection_none (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -448,7 +448,7 @@ gimp_selection_none (gint32 image_ID)
 
 /**
  * gimp_selection_feather:
- * @image_ID: The image.
+ * @image: The image.
  * @radius: Radius of feather (in pixels).
  *
  * Feather the image's selection
@@ -459,8 +459,8 @@ gimp_selection_none (gint32 image_ID)
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_feather (gint32  image_ID,
-                        gdouble radius)
+gimp_selection_feather (GimpImage *image,
+                        gdouble    radius)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -468,7 +468,7 @@ gimp_selection_feather (gint32  image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_DOUBLE, radius,
                                           G_TYPE_NONE);
 
@@ -490,7 +490,7 @@ gimp_selection_feather (gint32  image_ID,
 
 /**
  * gimp_selection_border:
- * @image_ID: The image.
+ * @image: The image.
  * @radius: Radius of border (in pixels).
  *
  * Border the image's selection
@@ -502,8 +502,8 @@ gimp_selection_feather (gint32  image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_border (gint32 image_ID,
-                       gint   radius)
+gimp_selection_border (GimpImage *image,
+                       gint       radius)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -511,7 +511,7 @@ gimp_selection_border (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, radius,
                                           G_TYPE_NONE);
 
@@ -533,7 +533,7 @@ gimp_selection_border (gint32 image_ID,
 
 /**
  * gimp_selection_grow:
- * @image_ID: The image.
+ * @image: The image.
  * @steps: Steps of grow (in pixels).
  *
  * Grow the image's selection
@@ -544,8 +544,8 @@ gimp_selection_border (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_grow (gint32 image_ID,
-                     gint   steps)
+gimp_selection_grow (GimpImage *image,
+                     gint       steps)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -553,7 +553,7 @@ gimp_selection_grow (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, steps,
                                           G_TYPE_NONE);
 
@@ -575,7 +575,7 @@ gimp_selection_grow (gint32 image_ID,
 
 /**
  * gimp_selection_shrink:
- * @image_ID: The image.
+ * @image: The image.
  * @steps: Steps of shrink (in pixels).
  *
  * Shrink the image's selection
@@ -587,8 +587,8 @@ gimp_selection_grow (gint32 image_ID,
  * Returns: TRUE on success.
  **/
 gboolean
-gimp_selection_shrink (gint32 image_ID,
-                       gint   steps)
+gimp_selection_shrink (GimpImage *image,
+                       gint       steps)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -596,7 +596,7 @@ gimp_selection_shrink (gint32 image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_INT32, steps,
                                           G_TYPE_NONE);
 
@@ -618,7 +618,7 @@ gimp_selection_shrink (gint32 image_ID,
 
 /**
  * gimp_selection_flood:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Remove holes from the image's selection
  *
@@ -632,7 +632,7 @@ gimp_selection_shrink (gint32 image_ID,
  * Since: 2.10
  **/
 gboolean
-gimp_selection_flood (gint32 image_ID)
+gimp_selection_flood (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -640,7 +640,7 @@ gimp_selection_flood (gint32 image_ID)
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
@@ -661,7 +661,7 @@ gimp_selection_flood (gint32 image_ID)
 
 /**
  * gimp_selection_save:
- * @image_ID: The image.
+ * @image: The image.
  *
  * Copy the selection mask to a new channel.
  *
@@ -672,7 +672,7 @@ gimp_selection_flood (gint32 image_ID)
  * Returns: The new channel.
  **/
 gint32
-gimp_selection_save (gint32 image_ID)
+gimp_selection_save (GimpImage *image)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -680,7 +680,7 @@ gimp_selection_save (gint32 image_ID)
   gint32 channel_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_NONE);
 
   if (pdb)
diff --git a/libgimp/gimpselection_pdb.h b/libgimp/gimpselection_pdb.h
index 3e34d007bd..740f9c8e73 100644
--- a/libgimp/gimpselection_pdb.h
+++ b/libgimp/gimpselection_pdb.h
@@ -32,36 +32,36 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gboolean               gimp_selection_bounds    (gint32    image_ID,
-                                                 gboolean *non_empty,
-                                                 gint     *x1,
-                                                 gint     *y1,
-                                                 gint     *x2,
-                                                 gint     *y2);
-gint                   gimp_selection_value     (gint32    image_ID,
-                                                 gint      x,
-                                                 gint      y);
-gboolean               gimp_selection_is_empty  (gint32    image_ID);
-gboolean               gimp_selection_translate (gint32    image_ID,
-                                                 gint      offx,
-                                                 gint      offy);
-G_GNUC_INTERNAL gint32 _gimp_selection_float    (gint32    drawable_ID,
-                                                 gint      offx,
-                                                 gint      offy);
-gboolean               gimp_selection_invert    (gint32    image_ID);
-gboolean               gimp_selection_sharpen   (gint32    image_ID);
-gboolean               gimp_selection_all       (gint32    image_ID);
-gboolean               gimp_selection_none      (gint32    image_ID);
-gboolean               gimp_selection_feather   (gint32    image_ID,
-                                                 gdouble   radius);
-gboolean               gimp_selection_border    (gint32    image_ID,
-                                                 gint      radius);
-gboolean               gimp_selection_grow      (gint32    image_ID,
-                                                 gint      steps);
-gboolean               gimp_selection_shrink    (gint32    image_ID,
-                                                 gint      steps);
-gboolean               gimp_selection_flood     (gint32    image_ID);
-gint32                 gimp_selection_save      (gint32    image_ID);
+gboolean               gimp_selection_bounds    (GimpImage *image,
+                                                 gboolean  *non_empty,
+                                                 gint      *x1,
+                                                 gint      *y1,
+                                                 gint      *x2,
+                                                 gint      *y2);
+gint                   gimp_selection_value     (GimpImage *image,
+                                                 gint       x,
+                                                 gint       y);
+gboolean               gimp_selection_is_empty  (GimpImage *image);
+gboolean               gimp_selection_translate (GimpImage *image,
+                                                 gint       offx,
+                                                 gint       offy);
+G_GNUC_INTERNAL gint32 _gimp_selection_float    (gint32     drawable_ID,
+                                                 gint       offx,
+                                                 gint       offy);
+gboolean               gimp_selection_invert    (GimpImage *image);
+gboolean               gimp_selection_sharpen   (GimpImage *image);
+gboolean               gimp_selection_all       (GimpImage *image);
+gboolean               gimp_selection_none      (GimpImage *image);
+gboolean               gimp_selection_feather   (GimpImage *image,
+                                                 gdouble    radius);
+gboolean               gimp_selection_border    (GimpImage *image,
+                                                 gint       radius);
+gboolean               gimp_selection_grow      (GimpImage *image,
+                                                 gint       steps);
+gboolean               gimp_selection_shrink    (GimpImage *image,
+                                                 gint       steps);
+gboolean               gimp_selection_flood     (GimpImage *image);
+gint32                 gimp_selection_save      (GimpImage *image);
 
 
 G_END_DECLS
diff --git a/libgimp/gimptextlayer_pdb.c b/libgimp/gimptextlayer_pdb.c
index c4102dbfc1..d3c937d1a6 100644
--- a/libgimp/gimptextlayer_pdb.c
+++ b/libgimp/gimptextlayer_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_text_layer_new:
- * @image_ID: The image.
+ * @image: The image.
  * @text: The text to generate (in UTF-8 encoding).
  * @fontname: The name of the font.
  * @size: The size of text in either pixels or points.
@@ -56,7 +56,7 @@
  * Since: 2.6
  **/
 gint32
-gimp_text_layer_new (gint32       image_ID,
+gimp_text_layer_new (GimpImage   *image,
                      const gchar *text,
                      const gchar *fontname,
                      gdouble      size,
@@ -68,7 +68,7 @@ gimp_text_layer_new (gint32       image_ID,
   gint32 layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, text,
                                           G_TYPE_STRING, fontname,
                                           G_TYPE_DOUBLE, size,
diff --git a/libgimp/gimptextlayer_pdb.h b/libgimp/gimptextlayer_pdb.h
index 6d82d4d6e9..da4be7f6e3 100644
--- a/libgimp/gimptextlayer_pdb.h
+++ b/libgimp/gimptextlayer_pdb.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gint32                gimp_text_layer_new                (gint32                 image_ID,
+gint32                gimp_text_layer_new                (GimpImage             *image,
                                                           const gchar           *text,
                                                           const gchar           *fontname,
                                                           gdouble                size,
diff --git a/libgimp/gimptexttool_pdb.c b/libgimp/gimptexttool_pdb.c
index 87fc632e2f..6ff05a6087 100644
--- a/libgimp/gimptexttool_pdb.c
+++ b/libgimp/gimptexttool_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_text_fontname:
- * @image_ID: The image.
+ * @image: The image.
  * @drawable_ID: The affected drawable: (-1 for a new text layer).
  * @x: The x coordinate for the left of the text bounding box.
  * @y: The y coordinate for the top of the text bounding box.
@@ -67,7 +67,7 @@
  * Returns: The new text layer or -1 if no layer was created.
  **/
 gint32
-gimp_text_fontname (gint32        image_ID,
+gimp_text_fontname (GimpImage    *image,
                     gint32        drawable_ID,
                     gdouble       x,
                     gdouble       y,
@@ -84,7 +84,7 @@ gimp_text_fontname (gint32        image_ID,
   gint32 text_layer_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_DRAWABLE_ID, drawable_ID,
                                           G_TYPE_DOUBLE, x,
                                           G_TYPE_DOUBLE, y,
diff --git a/libgimp/gimptexttool_pdb.h b/libgimp/gimptexttool_pdb.h
index cd357804aa..cc3b6ab7f7 100644
--- a/libgimp/gimptexttool_pdb.h
+++ b/libgimp/gimptexttool_pdb.h
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gint32   gimp_text_fontname             (gint32        image_ID,
+gint32   gimp_text_fontname             (GimpImage    *image,
                                          gint32        drawable_ID,
                                          gdouble       x,
                                          gdouble       y,
diff --git a/libgimp/gimptypes.h b/libgimp/gimptypes.h
index 5136684890..515ff5caea 100644
--- a/libgimp/gimptypes.h
+++ b/libgimp/gimptypes.h
@@ -37,6 +37,8 @@ typedef struct _GimpParamDef    GimpParamDef;
 typedef union  _GimpParamData   GimpParamData;
 typedef struct _GimpParam       GimpParam;
 
+typedef struct _GimpImage       GimpImage;
+
 
 /* FIXME move somewhere else */
 
diff --git a/libgimp/gimpvectors_pdb.c b/libgimp/gimpvectors_pdb.c
index b2bd3c2697..2d794e804d 100644
--- a/libgimp/gimpvectors_pdb.c
+++ b/libgimp/gimpvectors_pdb.c
@@ -36,7 +36,7 @@
 
 /**
  * gimp_vectors_new:
- * @image_ID: The image.
+ * @image: The image.
  * @name: the name of the new vector object.
  *
  * Creates a new empty vectors object.
@@ -49,7 +49,7 @@
  * Since: 2.4
  **/
 gint32
-gimp_vectors_new (gint32       image_ID,
+gimp_vectors_new (GimpImage   *image,
                   const gchar *name)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
@@ -58,7 +58,7 @@ gimp_vectors_new (gint32       image_ID,
   gint32 vectors_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, name,
                                           G_TYPE_NONE);
 
@@ -81,7 +81,7 @@ gimp_vectors_new (gint32       image_ID,
 
 /**
  * gimp_vectors_new_from_text_layer:
- * @image_ID: The image.
+ * @image: The image.
  * @layer_ID: The text layer.
  *
  * Creates a new vectors object from a text layer.
@@ -94,8 +94,8 @@ gimp_vectors_new (gint32       image_ID,
  * Since: 2.6
  **/
 gint32
-gimp_vectors_new_from_text_layer (gint32 image_ID,
-                                  gint32 layer_ID)
+gimp_vectors_new_from_text_layer (GimpImage *image,
+                                  gint32     layer_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -103,7 +103,7 @@ gimp_vectors_new_from_text_layer (gint32 image_ID,
   gint32 vectors_ID = -1;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_LAYER_ID, layer_ID,
                                           G_TYPE_NONE);
 
@@ -1133,7 +1133,7 @@ gimp_vectors_bezier_stroke_new_ellipse (gint32  vectors_ID,
 
 /**
  * gimp_vectors_import_from_file:
- * @image_ID: The image.
+ * @image: The image.
  * @filename: The name of the SVG file to import.
  * @merge: Merge paths into a single vectors object.
  * @scale: Scale the SVG to image dimensions.
@@ -1150,7 +1150,7 @@ gimp_vectors_bezier_stroke_new_ellipse (gint32  vectors_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_vectors_import_from_file (gint32        image_ID,
+gimp_vectors_import_from_file (GimpImage    *image,
                                const gchar  *filename,
                                gboolean      merge,
                                gboolean      scale,
@@ -1163,7 +1163,7 @@ gimp_vectors_import_from_file (gint32        image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, filename,
                                           G_TYPE_BOOLEAN, merge,
                                           G_TYPE_BOOLEAN, scale,
@@ -1196,7 +1196,7 @@ gimp_vectors_import_from_file (gint32        image_ID,
 
 /**
  * gimp_vectors_import_from_string:
- * @image_ID: The image.
+ * @image: The image.
  * @string: A string that must be a complete and valid SVG document.
  * @length: Number of bytes in string or -1 if the string is NULL terminated.
  * @merge: Merge paths into a single vectors object.
@@ -1215,7 +1215,7 @@ gimp_vectors_import_from_file (gint32        image_ID,
  * Since: 2.4
  **/
 gboolean
-gimp_vectors_import_from_string (gint32        image_ID,
+gimp_vectors_import_from_string (GimpImage    *image,
                                  const gchar  *string,
                                  gint          length,
                                  gboolean      merge,
@@ -1229,7 +1229,7 @@ gimp_vectors_import_from_string (gint32        image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, string,
                                           GIMP_TYPE_INT32, length,
                                           G_TYPE_BOOLEAN, merge,
@@ -1263,7 +1263,7 @@ gimp_vectors_import_from_string (gint32        image_ID,
 
 /**
  * gimp_vectors_export_to_file:
- * @image_ID: The image.
+ * @image: The image.
  * @filename: The name of the SVG file to create.
  * @vectors_ID: The vectors object to be saved, or 0 for all in the image.
  *
@@ -1279,7 +1279,7 @@ gimp_vectors_import_from_string (gint32        image_ID,
  * Since: 2.6
  **/
 gboolean
-gimp_vectors_export_to_file (gint32       image_ID,
+gimp_vectors_export_to_file (GimpImage   *image,
                              const gchar *filename,
                              gint32       vectors_ID)
 {
@@ -1289,7 +1289,7 @@ gimp_vectors_export_to_file (gint32       image_ID,
   gboolean success = TRUE;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           G_TYPE_STRING, filename,
                                           GIMP_TYPE_VECTORS_ID, vectors_ID,
                                           G_TYPE_NONE);
@@ -1312,7 +1312,7 @@ gimp_vectors_export_to_file (gint32       image_ID,
 
 /**
  * gimp_vectors_export_to_string:
- * @image_ID: The image.
+ * @image: The image.
  * @vectors_ID: The vectors object to save, or 0 for all in the image.
  *
  * Save a path as an SVG string.
@@ -1329,8 +1329,8 @@ gimp_vectors_export_to_file (gint32       image_ID,
  * Since: 2.6
  **/
 gchar *
-gimp_vectors_export_to_string (gint32 image_ID,
-                               gint32 vectors_ID)
+gimp_vectors_export_to_string (GimpImage *image,
+                               gint32     vectors_ID)
 {
   GimpPDB        *pdb = gimp_get_pdb ();
   GimpValueArray *args;
@@ -1338,7 +1338,7 @@ gimp_vectors_export_to_string (gint32 image_ID,
   gchar *string = NULL;
 
   args = gimp_value_array_new_from_types (NULL,
-                                          GIMP_TYPE_IMAGE_ID, image_ID,
+                                          GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
                                           GIMP_TYPE_VECTORS_ID, vectors_ID,
                                           G_TYPE_NONE);
 
diff --git a/libgimp/gimpvectors_pdb.h b/libgimp/gimpvectors_pdb.h
index 9679f511ed..27c6719f8e 100644
--- a/libgimp/gimpvectors_pdb.h
+++ b/libgimp/gimpvectors_pdb.h
@@ -32,9 +32,9 @@ G_BEGIN_DECLS
 /* For information look into the C source or the html documentation */
 
 
-gint32                gimp_vectors_new                       (gint32                  image_ID,
+gint32                gimp_vectors_new                       (GimpImage              *image,
                                                               const gchar            *name);
-gint32                gimp_vectors_new_from_text_layer       (gint32                  image_ID,
+gint32                gimp_vectors_new_from_text_layer       (GimpImage              *image,
                                                               gint32                  layer_ID);
 gint32                gimp_vectors_copy                      (gint32                  vectors_ID);
 gint*                 gimp_vectors_get_strokes               (gint32                  vectors_ID,
@@ -119,23 +119,23 @@ gint                  gimp_vectors_bezier_stroke_new_ellipse (gint32
                                                               gdouble                 radius_x,
                                                               gdouble                 radius_y,
                                                               gdouble                 angle);
-gboolean              gimp_vectors_import_from_file          (gint32                  image_ID,
+gboolean              gimp_vectors_import_from_file          (GimpImage              *image,
                                                               const gchar            *filename,
                                                               gboolean                merge,
                                                               gboolean                scale,
                                                               gint                   *num_vectors,
                                                               gint                  **vectors_ids);
-gboolean              gimp_vectors_import_from_string        (gint32                  image_ID,
+gboolean              gimp_vectors_import_from_string        (GimpImage              *image,
                                                               const gchar            *string,
                                                               gint                    length,
                                                               gboolean                merge,
                                                               gboolean                scale,
                                                               gint                   *num_vectors,
                                                               gint                  **vectors_ids);
-gboolean              gimp_vectors_export_to_file            (gint32                  image_ID,
+gboolean              gimp_vectors_export_to_file            (GimpImage              *image,
                                                               const gchar            *filename,
                                                               gint32                  vectors_ID);
-gchar*                gimp_vectors_export_to_string          (gint32                  image_ID,
+gchar*                gimp_vectors_export_to_string          (GimpImage              *image,
                                                               gint32                  vectors_ID);
 
 
diff --git a/pdb/groups/image.pdb b/pdb/groups/image.pdb
index 588ee4c54c..90bdbefe21 100644
--- a/pdb/groups/image.pdb
+++ b/pdb/groups/image.pdb
@@ -20,7 +20,7 @@ sub image_is_valid {
     $blurb = 'Returns TRUE if the image is valid.';
 
     $help = <<'HELP';
-This procedure checks if the given image ID is valid and refers to an
+This procedure checks if the given image is valid and refers to an
 existing image.
 HELP
 
@@ -33,7 +33,7 @@ HELP
 
     @outargs = (
         { name => 'valid', type => 'boolean',
-          desc => 'Whether the image ID is valid' }
+          desc => 'Whether the image is valid' }
     );
 
     %invoke = (
@@ -112,7 +112,7 @@ HELP
 
     @outargs = (
         { name => 'image', type => 'image',
-          desc => 'The ID of the newly created image' }
+          desc => 'The newly created image' }
     );
 
     %invoke = (
@@ -153,7 +153,7 @@ HELP
 
     @outargs = (
         { name => 'image', type => 'image',
-          desc => 'The ID of the newly created image' }
+          desc => 'The newly created image' }
     );
 
     %invoke = (
diff --git a/pdb/lib.pl b/pdb/lib.pl
index 7130dc112c..8dda2e79c5 100644
--- a/pdb/lib.pl
+++ b/pdb/lib.pl
@@ -215,6 +215,9 @@ sub generate {
            if (exists $_->{array}) {
                $value_array .= "NULL";
            }
+           elsif (exists $arg->{convert_func}) {
+               $value_array .= eval qq/"$arg->{convert_func}"/;
+            }
            else {
                $value_array .= "$var";
            }
diff --git a/pdb/pdb.pl b/pdb/pdb.pl
index e1a7ff20a7..238a506564 100644
--- a/pdb/pdb.pl
+++ b/pdb/pdb.pl
@@ -173,12 +173,13 @@ package Gimp::CodeGen::pdb;
                     gtype           => 'GIMP_TYPE_IMAGE_ID',
                     type            => 'GimpImage *',
                     const_type      => 'GimpImage *',
-                    id              => 1,
                     init_value      => 'NULL',
+                    out_annotate    => '(transfer full)',
                     get_value_func  => '$var = gimp_value_get_image ($value, gimp)',
-                    dup_value_func  => '$var = gimp_value_get_image_id ($value)',
-                    set_value_func  => 'gimp_value_set_image_id ($value, $var)',
+                    dup_value_func  => '$var = g_object_new (GIMP_TYPE_IMAGE, \"id\", $value, NULL)',
+                    set_value_func  => 'gimp_value_set_image_id ($value, gimp_image_get_id ($var))',
                     take_value_func => 'gimp_value_set_image ($value, $var)',
+                    convert_func    => 'gimp_image_get_id ($var)',
                     headers         => [ qw("core/gimpimage.h") ] },
 
     item        => { name            => 'ITEM',



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]