It is currently 21 Jan 2021, 12:33

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Paint based on Paths Plug-in (Experimentation)

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger

Paint based on Paths Plug-in (Experimentation)

Post#1 by tim » 30 Sep 2018, 19:34


WARNING: This plug-in is extremely slow.

Also I am not sure why but in GIMP 2.10.6, the plug-in will open and run the one time when you start-up, if you run it again it won't pop-up with option menu (so I have to restart GIMP in order to run it again).

Because it's slow, I suggest you running on a very small sample image first to see what it does before you go ahead and apply it to your big image.
paint_based_on_paths.py #
(6.92 KiB) Downloaded 80 times
paint_based_on_paths.py #
version 2. Just paintbrush instead of selection so we don't have to clear work area or deal with a work layer.
(7.09 KiB) Downloaded 81 times
2_8_speedy_package.zip #
speedy version for GIMP 2.8 only.
Run paint based on path to file, then run python3 calc.py then run paint based on paths from file... You'll have to change the path variable to point to a valid folder where your calc.py will reside.
(5.16 KiB) Downloaded 90 times
paint_based_on_paths.py #
edited for GIMP 2.10(.6).
Suggested size is spacing should be about 1/10 of brush size to cover most of painting.
(7.65 KiB) Downloaded 66 times
paint_based_on_paths.py #
version 5. GIMP 2.10.6. Try and continue on error
(7.69 KiB) Downloaded 68 times
paint_based_on_paths.py #
verion 7. GIMP 2.10.6 Added random_angle option for painting blotches (when direction doesn't matter).
(8.17 KiB) Downloaded 96 times
Instructions:
1. Open an image that you'd like plug-in to paint of.
2. Draw paths that define the stroke directions. You must draw your multiple paths on one path/vector layer. Plug-in only reads from first active path/vectors.
3. Run Plug-in (Python-Fu/Paint Based on Paths, select brush, change brush-size, change brush-spacing, and choose offset angle (If your brush is horizontal when the brush angle is set to zero then you just use 0 as angle offset, otherwise for example if you brush is vertical when the brush angle is set to zero then you might want to offset angle of 90 so that the brush generally follows the direction of the paths you have defined). Click OK to run script.
4. That's it.


Sample step 2:
monalisa_paths.jpg
monalisa_paths.jpg # (97.5 KiB) Viewed 3283 times (Thumbnail | Recognize)
Sample result:
monalisa1.jpg
monalisa1.jpg # (33.08 KiB) Viewed 3276 times (Thumbnail | Recognize)
aka Tin

         

tim
GL Blogger

Post#2 by tim » 02 Oct 2018, 16:12


approx 23 hrs. Not too many likes but getting some!
saskatchewan_elevator.jpg
saskatchewan_elevator.jpg # (88.94 KiB) Viewed 3228 times (Thumbnail | Recognize)
aka Tin

         

Pat625
Tutorial Creator

Post#3 by Pat625 » 02 Oct 2018, 17:31


That is really amazing to me, Tin. I know that it is not exactly like the original, but how does the script know the colors, etc. to use.

tim
GL Blogger

Post#4 by tim » 02 Oct 2018, 17:50


I have a loop that looks through all locations to draw based on spacing.
Then it mixes the order up randomly so you they don't get drawn in order like from left to right or whatever but randomly.
Then based on each draw location it grabs color of 4 pixels at that location and averages them and uses that as the brush stroke color.
Then it looks at all your defined paths, and finds the closest point to the draw location, finds out what angle the path is drawn and brushes a stroke of similar angle.

PS: I'd like to think of it as hybrid of human and computer art because I have to draw paths that tell it how to stroke so that's the human part, and it does the automation part of using colors and painting.
aka Tin

         

tim
GL Blogger

Post#5 by tim » 04 Oct 2018, 16:21


So it's not the code that is slow it's the GIMP version.
in GIMP 2.10.6 what usually takes 1 day or 2 to run I tried in GIMP 2.8 it takes about 1hr to run.
Not sure why that is but in GIMP 2.10.6 it goes away (the screen turns all black and white) between brush strokes while in GIMP 2.8 it's super fast.
aka Tin

         

tim
GL Blogger

Post#6 by tim » 06 Oct 2018, 00:16


On GIMP 2.8 I lowered the undo memory size and cache size down to like 2 Megabytes and It seems to stay speedy through out the whole process instead of starting out super fast and then slow down as it draws more.
aka Tin

         

skinnyhouse
Script Coder

Post#7 by skinnyhouse » 05 Jan 2019, 16:05


I have been experimenting with your Van Gogh brushes for adding more texture to some abstract backgrounds and getting some quite pleasing results - will post in the near future.

Thought I would have another look at this one.

Frustrated by running only once (2.10.8 gimp.org) so removed the brush dialog and used context settings from brush toolbox instead. Works fine for me and can re-run without quitting - some promising results when pasting generated new image paint layers and playing with different layer modes. Will post when I have results worth sharing.

skinnyhouse
Script Coder

Post#8 by skinnyhouse » 05 Jan 2019, 17:07


Okay so here is a sample from a fairly quick go...

The base image for a custom font background - shades of blue with gradients added:
Blue_Base.jpg
Blue_Base.jpg # (87.46 KiB) Viewed 2964 times (Thumbnail | Recognize)
Simple path added...
Paths.JPG
Paths.JPG # (50.85 KiB) Viewed 2964 times (Thumbnail | Recognize)
Blotch brush used to create a texture...
Blue_Blotches.jpg
Blue_Blotches.jpg # (125.19 KiB) Viewed 2964 times (Thumbnail | Recognize)
Van Gogh brush used to make a variation...
Blue_Van_Gogh.jpg
Blue_Van_Gogh.jpg # (183.5 KiB) Viewed 2964 times (Thumbnail | Recognize)
Sample letter taken from the Blotched background (bump-mapped on itself) with shine effect added...
Bravado_Part_Blotch.png
Bravado_Part_Blotch.png # (176.21 KiB) Viewed 2964 times (Thumbnail | Recognize)

Pat625
Tutorial Creator

Post#9 by Pat625 » 05 Jan 2019, 22:42


I really like that! It has that "painterly" look to it! You are a real VanGogh!

tim
GL Blogger

Post#10 by tim » 06 Jan 2019, 00:40


superb use of this plug-in skinnyhouse!
That texture on the W looks professional
aka Tin

         


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 22 guests