It is currently Sat Jun 15, 2024 4:59 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 312 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 16  Next
Author Message
 Post subject: Re: Multi-Fill Script Help
PostPosted: Thu Jun 27, 2013 9:09 pm  (#81) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
dinasset wrote:
Rod,
I'm not expert enough on scripts to know whether is it possible to understand (by code statements, I mean) the presence of transparent areas in the base image/layer:
1 - IF YES, when a script not only ignores those areas (which is acceptable), but is going into an endless loop if they are present (causing GIMP to be forced closed -see experience of odinbc in addition to mine), then IT SHOULD REFUSE to execute issuing a warning message
2 - IF NOT, it could be nice for the users to see a warning on top of the parameters windows informing "this script is unable to deal with transparent areas" or similar

I agree. it is probably a good idea for a dialog to pop up stating the script only works with a white bg with dark lines.However you could add this yourself in the pop-up blurb that shows when you mouse over it in the menu. :)
Image

Just a short fix to remind yourself. :)
You would change it here (about line #343)
(script-fu-register "script_fu_MultiFill"
                    "<Image>/Filters/Flatting/MultiFill..."
                    "WILL NOT WORK ON TRANSPARENT LAYERS - Fills every separate area with a different colour from the palette."
                    "Rob Antonishen"
                    "Rob Antonishen"
                    "Dec 2008"
                    "RGB* GRAY*"
                    SF-IMAGE      "image"      0
                    SF-DRAWABLE   "drawable"   0
                    SF-COLOR      "MultiFill Colour"       "white"
                    SF-ADJUSTMENT "Colour Threshold"       (list 16 0 255 1 10 0 SF-SLIDER)
                    SF-OPTION     "Fill Type"              (list "Random Colours" "Random Greyscale" "Palette" "Palette Random" "Gradient with Random Direction" "Gradient with Specified Direction" "Pattern Directory")
                    SF-PALETTE    "Choose Fill Palette"    "Default"
               SF-ENUM "Blend Mode" '("BlendMode" "custom-mode")
               SF-ENUM "Gradient Style" '("GradientType" "gradient-linear")
                    SF-ADJUSTMENT "Gradient Direction"     (list 135 0 360 1 15 1 SF-SLIDER)
                    SF-DIRNAME    "Pattern Directory"      (string-append gimp-directory "/patterns/")
                    SF-ADJUSTMENT "Ignore Areas <="        (list 3 0 255 1 10 1 SF-SLIDER)
                    SF-ADJUSTMENT "Flag Areas <="          (list 10 0 255 1 10 1 SF-SLIDER)
                    SF-COLOR      "Flag Colour"            "magenta"
                    SF-OPTION     "Area Size Check Method" (list "Width & Height" "Area")                   
                    SF-TOGGLE     "Copy Layer First"       TRUE
                    SF-TOGGLE     "Flatten After"           TRUE
                    SF-TOGGLE     "Hide While Processing"  TRUE
)

_________________
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 subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 4:16 am  (#82) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks Rod!
I did what you suggested (maybe someone else will do the same...)
btw, another thing about the FlattingTools: I guess the "Flatten" part (first entry under menu Flatting) is useless: I didn't see a use, so to test whether it's relevant to the main part "Multi-fill" I did remove it completely from my copy and tested again Multi-fill: it works alone.
Did I miss something about the use of Flatten? It says "Flattens an image that has been multicoloured", but this is already performed inside the Multi-fill; definitely I should have missed something...Can you help me also on that?

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 5:35 am  (#83) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
dinasset wrote:
Thanks Rod!
I did what you suggested (maybe someone else will do the same...)
btw, another thing about the FlattingTools: I guess the "Flatten" part (first entry under menu Flatting) is useless: I didn't see a use, so to test whether it's relevant to the main part "Multi-fill" I did remove it completely from my copy and tested again Multi-fill: it works alone.
Did I miss something about the use of Flatten? It says "Flattens an image that has been multicoloured", but this is already performed inside the Multi-fill; definitely I should have missed something...Can you help me also on that?

After running multifill you will have 2 layers.
1 colors
2 the comic outline
Select the comic (white and black lined layer) and run Flatten.
This will make little uncolored spots take the colour of the nearest area on the color layer.

Best i can explain it. The Flatten script is written inside the multifill script so you can run flatten from the multifill dialog or the menu link.
Rob A would explain better than i of course. :)

_________________
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 subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 5:58 am  (#84) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks Rod,
I did as suggested: it really removes the black lines used as separators for the areas (the black and white layer becomes a white layer); is this the effect also for you or is it there something wrong in my version?
If this is the correct effect, I would say (for myself): use it when you like to see all the coloured areas without separating lines (sometimes, this is better, sometimes not)

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 6:29 am  (#85) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
dinasset wrote:
Thanks Rod!
I did what you suggested (maybe someone else will do the same...)
btw, another thing about the FlattingTools: I guess the "Flatten" part (first entry under menu Flatting) is useless: I didn't see a use, so to test whether it's relevant to the main part "Multi-fill" I did remove it completely from my copy and tested again Multi-fill: it works alone.
Did I miss something about the use of Flatten? It says "Flattens an image that has been multicoloured", but this is already performed inside the Multi-fill; definitely I should have missed something...Can you help me also on that?

The ability to run Flatten separately is provided because Multi-fill provides the option of "flagging" areas that are below a certain size (but larger than "joined" areas). These "flagged" areas are painted in the specified 'Flag color', which permits the artist to manually examine them to decide whether they should be the same color as the surrounding area (i.e., "joined"), or a different color from the palette.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 6:37 am  (#86) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks Saulgoode!
But, as I asked to Rod, is it normal by using Flatten that black separators disappear? Just to know

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 9:21 am  (#87) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Hi-

To answer a few questions:

- I wrote the script, which performs similar to a photoshop plugin that someone was looking for in gimp. I don't use it often myself, except for some texture creation. The name "Flatting Tools" comes from what the process is referred to by colourists.

- "Flatten" is meant to remove the black lines leaving only the coloured areas, and as SG mentioned, it is either used directly if selected in the multifill script or is available to be called manually after.

- The script works for me when called on a layer with transparent areas. The script uses the stock select by colour with threshold to select the background area

- There was an infinite loop which could occur if the script was invoked if there is no or very little of the selected bg colour in the image (nothing to do with transparency). I've added an explicit check for no colour, and added a check to detect the infinate loop situation and abort, with a message to run multifill without flatting. (It is a limitation of the built in dilate math that causes the loop).

- I can't reproduce the error "Unable to run GimpPdbProgress callback. The corresponding plug-in may have crashed." What version of gimp is this with?

I've uploaded the fix for the infinate loop to the gimp-plugin registry http://registry.gimp.org/node/14051 but it seems to have appended a _0 to the file, so if you replace yours, make sure the name is correct and the old one gets overwritten.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 10:34 am  (#88) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
RobA, thanks for your attention.
I downloaded the new version replacing the previous one.
One quick reply (other tests will follow):
- the error messages
"GIMP Error
Unable to run GimpPdbProgress callback. The corresponding plug-in may have crashed."
still occur.
Did you load my initial draw on page 8 of this topic and try with that?
I did and I still get those messages (also Odinbc had my same result)
But I reply quickly only about this test because there must have been some other change in the script, so that the output -which was very nice as usual in spite of the errors- now is very poor in colours.
I attach here my new result, so you can verify yourself
(my environment is Win 7 32 bits, Gimp now at 2.8.6, was 2.8.4 previously)


Attachments:
new-out.png
new-out.png [ 88.67 KiB | Viewed 3062 times ]

_________________
"Where am I ?"
Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 10:54 am  (#89) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
additional tests:
- checked -as you said- that now an image with only transparent areas and black separator lines (typical output of script Pursuit Curve DOES NOT GO ANY MORE into an endless loop, I get immediately a totally black image; thanks for this important improvement
- checked that -if there is some coloured area and not only transparent ones- there is no error, but I get as result what I consider a "strange" output (maybe it's not so for you and other users); so I attach the result for your double-check
Attachment:
strange-for-me.png
strange-for-me.png [ 30.04 KiB | Viewed 3054 times ]

(note: I filled with white alternate spaces, I attach here also the input but in the preview everything appears to be white so you cannot see this alternated white-transparent areas
Attachment:
input-for-result-strange-for-me.png
input-for-result-strange-for-me.png [ 19.79 KiB | Viewed 3054 times ]

the sections which I filled with white are those that have been correctly filled with random colours by the plug-in

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 11:39 am  (#90) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
I confirm -through other tests- that with any kind of input, if one of the two "gradient" fill-options is selected, the gradient applied is always black-to-white.
Odinbc, could you double-check, please?

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 12:58 pm  (#91) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
I confirm also that the problem with the fill gradient in B/W applies only to the most recent version.
I was able to get back the previous version, reloaded with a different name not to override the last one, and I got fantastic gradient-fill results.
RobA: before you "hit" me, I've nothing against your script, it produces wonderful results, I'm sincere: All what I put here was -and is- to help you removing some pitfalls because I interpreted the role of a Gimp-Chatter acting also as a tester, so from time to time I perform a kind of "monkey test" on the plug-ins I find here.

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 2:14 pm  (#92) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Again - what version of Gimp are you using, and what language is installed on your machine?

I am unable to reproduce your issues.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 2:24 pm  (#93) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
the last line of my FIRST reply was:
(my environment is Win 7 32 bits, Gimp now at 2.8.6, was 2.8.4 previously)

edit: Odinbc reproduced immediately my problem on messages (probably, he has my same environment)
I asked him to try also on the new version to confirm or not my tests, but so far I didn't get a reply in here

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 3:47 pm  (#94) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
Gimp 2.8.6, Visa32, new v. MultiFill
(with Gradient fill options)

If I run MultiFill after samj Pursuit Curve, error message now,
GIMP Error wrote:
MultiFill Warning
Endless loop detected - flatting failed. Please uncheck 'Flatten After' and try again.
Rerun, unchecking 'Flatten After' result in no error, no loop & a black background.

If I run dinasset test image the result is the same as dinasset's image. Error 3 times,
GIMP Error wrote:
Unable to run GimpPdbProgress callback. The corresponding plug-in may have crashed.
I hope that info helps. :)

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jun 28, 2013 3:54 pm  (#95) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
thanks Odinbc!
so it seems this time win 7 32 bits has no responsibility: you Odinbc run Ubuntu 12x
curious to know whether with a partially filled in Pursuit you also get "strange" dilated colours, as me

edit: I read now better, you did the test on Win Vista, not Ubuntu, sorry

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Thu Jul 04, 2013 1:51 pm  (#96) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Found some time to get back to this.

The image in viewtopic.php?f=8&t=1221&hilit=multifill&start=80#p99780 produces exactly the results I'd expect. The filter uses the identified colour (white) and treats everything else, including transparent areas as "not white" (as this was written initially to deal with scanned art which would have no transparency, typically). A workaround to get the results you want would be to run multi-fill, take the original copied layer and do "Alpha to selection" then invert the selection and on the multi-filled layer hit the delete key to delete the original transparent layers.

I'm changing the script to transfer the transparency of the source layer to the final layer, as this would "make sense" from a user perspective if there is transparency in the source layer:
Attachment:
mf_trans.png
mf_trans.png [ 32.71 KiB | Viewed 2941 times ]


The error
Unable to run GimpPdbProgress callback. The corresponding plug-in may have crashed.

appears to be a bug with the script-fu display window that randomly(?) occurs when calling "gimp-edit-blend" (as it ONLY happens with gradient modes). It is definitely repeatable, but random, since after adding additional debugging, it clearly happens for different sections even when rerunning on the same image repeated times.

If you runs the script and it causes this error, close the newly created image and rerun the script using ctrl+f (Filters->repeat) and it will run without the error... no matter how many times it is repeated (on my system) which is why I suspect the error is stemming from the gimp script-fu plugin when a script calls the gimp-edit-blend.

I also can't get it to happen from the scheme console, even when calling random fills in a tight loop, which lends more credence to the idea that it is a script-fu plugin GUI issue.

I'm changing the script to send errors to the error-log rather than the pop-up message box to the error is less intrusive.

Attached is an updated version - give it a try please and see if it does what you hope.

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Last edited by RobA on Fri Jul 05, 2013 11:39 am, edited 1 time in total.

Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Thu Jul 04, 2013 3:26 pm  (#97) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Thanks Rob for your support!
Downloaded and given some tests.
1.using the new version (random colours fill) on a PursuitCurve filled alternatively white/ transparency, gives the desired result (attachment RobATransp)
2.using the new version (gradient fill) on a PursuitCurve completely filled with white gives still B/W gradients, while the (old) Graechan version produces nice random coloured gradients (attachments RobAGradient, GraechanGradient).
Could you double-check? Thanks
Attachment:
RobATransp.png
RobATransp.png [ 32.25 KiB | Viewed 2932 times ]
Attachment:
RobAGradient.png
RobAGradient.png [ 155.12 KiB | Viewed 2932 times ]
Attachment:
GraechanGradient.png
GraechanGradient.png [ 151.31 KiB | Viewed 2932 times ]

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Thu Jul 04, 2013 3:50 pm  (#98) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
dinasset wrote:
Thanks Rob for your support!
Downloaded and given some tests.
...
2.using the new version (gradient fill) on a PursuitCurve completely filled with white gives still B/W gradients, while the (old) Graechan version produces nice random coloured gradients (attachments RobAGradient, GraechanGradient).
Could you double-check?


Hi. There is an option. To use the fg-bg gradient, or random gradients. I could not remove the regular gradient options, as it is one I use regularly :)

Try it selecting the "Random" options rather than "FG to BG (RGB)".

-RobA>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Thu Jul 04, 2013 11:54 pm  (#99) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
OK, thanks Rob.
So far, I didn't change that parameter probably because -by using Graechan version- it is not required (maybe it does it by itself).
Yes, changing that parameter, I get coloured gradients, thanks.
Still one (very small) question: the default parameter says "FG to BG", but that's not true for me: I have BG / FG colours different from Black and White (I have and I tested having Red and Yellow), but if I leave that option the gradient produced is really Black to White, not BG to FG.
So, if this happens also in your environment, better to change the text, maybe...

_________________
"Where am I ?"


Top
 Post subject: Re: Multi-Fill Script Help
PostPosted: Fri Jul 05, 2013 11:43 am  (#100) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Quote:
So far, I didn't change that parameter probably because -by using Graechan version- it is not required (maybe it does it by itself).


I took the idea from the Graechan version but changed it a bit, so that parameter is necessary to select random or not.

Quote:
Still one (very small) question: the default parameter says "FG to BG", but that's not true for me: I have BG / FG colours different from Black and White (I have and I tested having Red and Yellow), but if I leave that option the gradient produced is really Black to White, not BG to FG.


Thanks for catching that.... I wasn't resetting the colours to the context colours before blending...

Attached is a version with that fixed. If it looks OK, I'll also update the GPR version.

Thanks for the feedback.

-Rob A>


Attachments:
FlattingTools.scm [17.74 KiB]
Downloaded 166 times

_________________
Image
Fantasy Cartography and Mapping by RobA
Top
Post new topic Reply to topic  [ 312 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 16  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Seeking Help with First Multi-File Batch Script

9

No new posts Palette from multi image

2

No new posts Attachment(s) Fill with pattern seamless

13

No new posts Line art detection bucket fill

0

No new posts Filled path not exporting with fill

4


cron

* Login  



Powered by phpBB3 © phpBB Group