It is currently Sat Jul 06, 2024 7:08 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Random fill with brush
PostPosted: Sat Nov 26, 2011 1:47 pm  (#21) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
I second PC's request.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Random fill with brush
PostPosted: Sat Nov 26, 2011 3:08 pm  (#22) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
ofnuts wrote:
lylejk wrote:
RobA has a similar script-fu for filling in a pattern; slow but I like the result. Other then a no selection, if you use your python plugin, the perimeter of the selection get's chopped off brushs as all selection fills do. Wondering if you can do this plugin like RobAs; pythons much faster then Script-fu. Below for recent reference. :)

http://gimpchat.com/viewtopic.php?f=11&t=530

The difference is not Python vs Scheme because both scripts spend most of their time in Gimp's bowels. Rob's script could bracket the code in undo-freeze/thaw. At least that's what made mine run a lot faster.


@lylejk - Unfortunately ofnuts is correct in that the main performance hit I get is because of the pixel sampling (as far as I know, sampling a drawable is slow, both in scheme and python). his script should be a little faster as he uses the histogram function to access the percentage covered for the entire image, which my script can'r do as it is varying the density based on the source map rather than being the same density over the entire image.

If you need a fixed density, his is definitely the one to use as it will be faster.

@offnuts - My experimenting with undo freeze/thaw has shown to me it should only be used on a new image, not the user's working image, as it borks u pthe undo history completely. I have made a few other scripts where I create a new image (never displayed) and copy of the desires source layers, freeze the undo stack on that image and process. This really improves performance. In the case of this script, I wanted to have the visible feedback of the script working so the fill appropriateness could be judged easier and the script aborted if necessary, rather than having to wait a (still) long time with the work being done in a hidden image. I should test and see the performance improvement though - it might be worth it.

Ideally, I should just write a C plugin and be done with it.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Random fill with brush
PostPosted: Sat Nov 26, 2011 3:44 pm  (#23) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
RobA wrote:
@offnuts - My experimenting with undo freeze/thaw has shown to me it should only be used on a new image, not the user's working image, as it borks u pthe undo history completely. I have made a few other scripts where I create a new image (never displayed) and copy of the desires source layers, freeze the undo stack on that image and process. This really improves performance. In the case of this script, I wanted to have the visible feedback of the script working so the fill appropriateness could be judged easier and the script aborted if necessary, rather than having to wait a (still) long time with the work being done in a hidden image. I should test and see the performance improvement though - it might be worth it.
My current version (not the on on SF) does:

undo_group_start()
context_push()
[b][i]create layer[/i][/b]
undo_freeze()
[b][i]fill layer[/i][/b]
undo_thaw()
context_pop()
undo_group_end()

and it seems to work fine for the undo.

_________________
Image


Top
 Post subject: Re: Random fill with brush
PostPosted: Sat Nov 26, 2011 7:03 pm  (#24) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
ofnuts wrote:
RobA wrote:
@offnuts - My experimenting with undo freeze/thaw has shown to me it should only be used on a new image, not the user's working image, as it borks u pthe undo history completely. I have made a few other scripts where I create a new image (never displayed) and copy of the desires source layers, freeze the undo stack on that image and process. This really improves performance. In the case of this script, I wanted to have the visible feedback of the script working so the fill appropriateness could be judged easier and the script aborted if necessary, rather than having to wait a (still) long time with the work being done in a hidden image. I should test and see the performance improvement though - it might be worth it.
My current version (not the on on SF) does:

undo_group_start()
context_push()
[b][i]create layer[/i][/b]
undo_freeze()
[b][i]fill layer[/i][/b]
undo_thaw()
context_pop()
undo_group_end()

and it seems to work fine for the undo.



I tried exactly that (wrapping the main loop of the script) in a freeze/thaw pair, and while it runs in 1/3 less time, Undo does nothing afterwards.... I wonder if this is a bug in scheme if it works in python...

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 7:10 am  (#25) 
Offline
GimpChat Member
User avatar

Joined: Apr 09, 2011
Posts: 1764
where would this reside within GIMP???


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 8:21 am  (#26) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
akky wrote:
where would this reside within GIMP???

If you are asking about my script, it shows up under Filters/Render

_________________
Image


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 8:30 am  (#27) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
RobA wrote:
ofnuts wrote:
RobA wrote:
@offnuts - My experimenting with undo freeze/thaw has shown to me it should only be used on a new image, not the user's working image, as it borks u pthe undo history completely. I have made a few other scripts where I create a new image (never displayed) and copy of the desires source layers, freeze the undo stack on that image and process. This really improves performance. In the case of this script, I wanted to have the visible feedback of the script working so the fill appropriateness could be judged easier and the script aborted if necessary, rather than having to wait a (still) long time with the work being done in a hidden image. I should test and see the performance improvement though - it might be worth it.
My current version (not the on on SF) does:

undo_group_start()
context_push()
[b][i]create layer[/i][/b]
undo_freeze()
[b][i]fill layer[/i][/b]
undo_thaw()
context_pop()
undo_group_end()

and it seems to work fine for the undo.



I tried exactly that (wrapping the main loop of the script) in a freeze/thaw pair, and while it runs in 1/3 less time, Undo does nothing afterwards.... I wonder if this is a bug in scheme if it works in python...

-Rob A>
Cross-checked my code and it works flawlessly with the undo/redo. I updated the SF version if you want to check it out. I doubt the problem is Scheme vs Python...

_________________
Image


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 9:00 am  (#28) 
Offline
GimpChat Member
User avatar

Joined: Apr 09, 2011
Posts: 1764
ofnuts wrote:
akky wrote:
where would this reside within GIMP???

If you are asking about my script, it shows up under Filters/Render


Thanks ofnuts...one can only hope...but I dont see it sadly :(
Some of the python filters show and some dont....

Mac OS X 10.6.8 if you are wondering.
:gaah


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 12:40 pm  (#29) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2011
Posts: 395
Location: Indianapolis, IN
If I try this with a brush that is NOT from the gimp install the script screams at me:

<type 'exceptions.IOError'>: [Errno 9] Bad file descriptor

*burp said Gimp*

_________________
"That which does not kill us makes us stronger." ~ Friedrich Nietzsche


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 12:58 pm  (#30) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2011
Posts: 395
Location: Indianapolis, IN
If I try this with a brush that is NOT from the gimp install the script screams at me:

<type 'exceptions.IOError'>: [Errno 9] Bad file descriptor

*burp said Gimp*

I have python installed and other python scripts work find.

_________________
"That which does not kill us makes us stronger." ~ Friedrich Nietzsche


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 1:14 pm  (#31) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
akky wrote:
ofnuts wrote:
akky wrote:
where would this reside within GIMP???

If you are asking about my script, it shows up under Filters/Render


Thanks ofnuts...one can only hope...but I dont see it sadly :(
Some of the python filters show and some dont....

Mac OS X 10.6.8 if you are wondering.
:gaah


I have a lot of py filters that don't show up, but all the scm filters do show up and work fine. I wondered if it was because of osx and why py's would be so different from scm's.


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 1:32 pm  (#32) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
2-ton wrote:
I have a lot of py filters that don't show up, but all the scm filters do show up and work fine. I wondered if it was because of osx and why py's would be so different from scm's.

Technically , Scheme scripts are plain files that are executed by the Scheme executor that itself behaves as a plugin. But the Python plugins behave like full-blown plugins, exactly as if they were compiled C. I don't know much about OSX, but a glance at Wikipedia tells me it handles file permissions the Unix way: this means that plugin executables (this includes the .py files in the plugin directory), should have the executable bit set. In Linux, those without that flag don't show up either.

_________________
Image


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 2:59 pm  (#33) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
gah, I have no idea how one sets an executable bit.


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 3:11 pm  (#34) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
2-ton wrote:
gah, I have no idea how one sets an executable bit.
In Linux "chmod +x {file}" in the CLI, and in the graphical file explorers, usually somewhere in the right-click menu, the "properties" or "access control" or "permissions".

_________________
Image


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 5:06 pm  (#35) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
afaik, I do have admin. permission for everything on this computer...is that what you mean? It's all above my understanding.


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 5:17 pm  (#36) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
He meant the individual file. Right click the file in the folder and check Properties, to see if it has been given permission, etc. Not sure how that works in a Mac.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Random fill with brush
PostPosted: Sun Nov 27, 2011 9:19 pm  (#37) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
on my mac I right click and then click on get info and it shows that it is not locked, and I have permissions to read and write. and it opens with python launcher app.


Top
 Post subject: Re: Random fill with brush
PostPosted: Wed Nov 30, 2011 1:15 am  (#38) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2011
Posts: 395
Location: Indianapolis, IN
:bump

There was a lot of traffic in thread when I posted and it may have gotten over looked.

If I try this with a brush that is NOT from the gimp install the script screams at me:

Quote:
Fill with brush strokes to density Warning <type 'exceptions.IOError'>: [Errno 9] Bad file descriptor


*burp said Gimp*

I have python installed and other python scripts work fine, any ideas?

_________________
"That which does not kill us makes us stronger." ~ Friedrich Nietzsche


Top
 Post subject: Re: Random fill with brush
PostPosted: Wed Nov 30, 2011 2:41 am  (#39) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
MrBiggz wrote:
:bump

There was a lot of traffic in thread when I posted and it may have gotten over looked.

If I try this with a brush that is NOT from the gimp install the script screams at me:

Quote:
Fill with brush strokes to density Warning <type 'exceptions.IOError'>: [Errno 9] Bad file descriptor


*burp said Gimp*

I have python installed and other python scripts work fine, any ideas?
The error is strange because the script never deals with the brush file (all brush handling is done using the Gimp primitives). Post the brush somewhere or tell me where I can get it.

_________________
Image


Top
 Post subject: Re: Random fill with brush
PostPosted: Wed Nov 30, 2011 2:25 pm  (#40) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I use non default brushes with the script just fine.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Fill with pattern seamless

13

No new posts Filled path not exporting with fill

4

No new posts Line art detection bucket fill

0

No new posts Bucket fill white comes out as grey

4

No new posts Attachment(s) Random Art Prompt II (next deadline Sunday Dec 12)

172



* Login  



Powered by phpBB3 © phpBB Group