Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get_pixel_rgn() function in gimp 3 python
#1
Is there any function in gimp 3 python which replaces layer.get_pixel_rgn(0, 0, layer.width, layer.height) ? I tried but this function is not working.
Reply
#2
(04-04-2021, 05:02 AM)ksoman Wrote: Is there any function in gimp 3 python which replaces layer.get_pixel_rgn(0, 0, layer.width, layer.height) ? I tried but this function is not working.

The following is from the GIMP Python documentation (layers are drawables):

drawable.get_pixel_rgn(x, y, w, h, [dirty, [shadow])

Creates a pixel region for the drawable. It will cover the region with origin (x,y) and dimensions w x h. The dirty argument sets whether any changes to the pixel region will be reflected in the drawable (default is TRUE). The shadow argument sets whether the pixel region acts on the shadow tiles or not (default is FALSE). If you draw on the shadow tiles, you must call drawable.merge_shadow() for changes to take effect.
Reply
#3
(04-04-2021, 04:30 PM)programmer_ceds Wrote:
(04-04-2021, 05:02 AM)ksoman Wrote: Is there any function in gimp 3 python which replaces layer.get_pixel_rgn(0, 0, layer.width, layer.height) ? I tried but this function is not working.

The following is from the GIMP Python documentation (layers are drawables):

drawable.get_pixel_rgn(x, y, w, h, [dirty, [shadow])

   Creates a pixel region for the drawable. It will cover the region with origin (x,y) and dimensions w x h. The dirty argument sets whether any changes to the pixel region will be reflected in the drawable (default is TRUE). The shadow argument sets whether the pixel region acts on the shadow tiles or not (default is FALSE). If you draw on the shadow tiles, you must call drawable.merge_shadow() for changes to take effect.

This function does not work in gimp 3.
Reply
#4
I don't think there is a specific python documentation for Gimp v3. The only Python API doc I know is for Gimp 2.x and Python 2.7. AFAIK the intent of the developers is for all languages (except perhaps script-fu) to use Glib introspection to access the API available to all plugins.

IMHO unless you really need to use the raw 32-bit data in your plugin it will be a lot easier to use Gimp 2.10 and Python V2.
Reply


Forum Jump: