Post Reply 

processing tile by tile

Jul 20, 2014, 17:47
Post: #1
processing tile by tile
What is the best way to process an image tile by tile?

I want to do some brightness correction with a self coded python plugin. My current approach is to use pdb.gimp_image_select_rectangle() to select one rectangle after the other and to process each rectangle individually.

My problem is, the script should only manipulate the (mostly rectangular) part(s) of the image, which were selected by hand before the script gets invoked.

What is the best approach for this?
- Is it possible to make a backup of the current selection, intersect it with a rectangular selection and to restore the former selection in order to carry on with the next rectangle?

- Or can/should I generate temp. layers to accomplish this? If so, atm I have no clue how to do so.

(Perhaps a dumb question, sorry I am a python-fu beginner.)
Find all posts by this user
Quote this message in a reply
Jul 20, 2014, 19:07 (This post was last modified: Jul 20, 2014 19:13 by janny.)
Post: #2
RE: processing tile by tile
This is not about processing time.

I want to optimize the brightness locally, i.e. tile for tile.
Find all posts by this user
Quote this message in a reply
Jul 20, 2014, 19:32
Post: #3
RE: processing tile by tile
(Jul 20, 2014 19:25)ofnuts Wrote:  Then it depends if whatever you use is taking the selection in account or not. Otherwise a simple solution it to duplicate the layer, crop it to the part you want to change, apply the changes, and merge it down in the source layer. Don't forget to free/thaw the undo stack around this to skpi the time/memory consuming undo stack updates.

Thanks ofnuts,

do you have a link to any example code, so that I can see how to create these additional layers etc. ?
Find all posts by this user
Quote this message in a reply
Jul 21, 2014, 15:50
Post: #4
RE: processing tile by tile
Thank you ofnuts!
I think this will help me a lot.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Batch processing script Help jarboe3142 3 425 Jun 1, 2014 21:53
Last Post: paynekj
  Replace with tile filter? aaronfranke 1 340 Jul 14, 2013 09:03
Last Post: ofnuts
  Anaglyph Batch Processing vertigoChuck 8 1,497 Jun 28, 2012 14:34
Last Post: vertigoChuck

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS