It is currently Thu Apr 25, 2024 7:02 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: simple auto-random colorize script
PostPosted: Thu May 28, 2015 2:22 pm  (#1) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
UPDATE: Now available on gimpscripts.com


I thought this would be good to have sometime i want many random colors before i call the Auto Hatch Layers script
this is version 1(simple colorize)
Attachment:
AutoColorize.scm [2.61 KiB]
Downloaded 375 times

version 2 is below, scroll down.
It'll be available under Script-Fu-> Auto Colorize


Image

a test
Image

then called the hatch script
Image


The script above just does colorization it doesn't consider perceived lightness.
This version calculates perceived lightness and picks a random color with the same perceived lightness.
So if you were to gray scale mode it it looks like gray scale mode of the original image.
I am still experimenting around but this one looks much i better i think than the version above.
this is version 2(colorized based on perceived brightness)
Attachment:
AutoColorize.scm [4.25 KiB]
Downloaded 254 times

It'll be available under Script-Fu -> Auto colorize
Image

here's a sample of 15 colors, then hatched.
Image
here's another sample...
source image: Image
after auto-colorize of 12 colors
Image

Because it is random, each time you run this script, you'll get a different result.


this is version 3 of the script(primary color variations)
Attachment:
AutoColorize.scm [5.02 KiB]
Downloaded 220 times

available under Script-Fu -> Auto colorize
It was aimed toward producing a generally variations of primary colors (aimed toward the RAP[random art prompt of Primary colors])
Image

What the script does is it tries from highest value of when luminance is less than 1/3 of the maximum it tries to use maximum blue values and then random values of red and green until it finds variation of blue that has the same luminance as original.
When luminance is the middle 3rd chunk it tries maximum red values and other random values of blue and green.
When luminance is the top 3rd chunk it tries maximum green values and other random values of red and green.
Because it has to seek for colors of same luminance based on random values, this script might take a while on darker colors, at times it seems like it's stalling, it's not let it do its work.
Here's an example, it's generally blue red and green but there are slight variations of each of these colors.
Image

_________________
TinT


Last edited by trandoductin on Mon Jun 01, 2015 11:00 am, edited 4 times in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Thu May 28, 2015 10:47 pm  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
limey Audrey Hepburn
Image

and limey John Lennon...
I lucked out and got the blues (cold colors) to go generally in the dark and warmer colors in the bright..so I really like how this one turned out.
Image

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Fri May 29, 2015 12:29 pm  (#3) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
I couldn't add more than 3 attachments.

this is version 4 (true to how gimp converts to grayscale mode, aim toward generally primary colors)
Attachment:
AutoColorize.scm [5.15 KiB]
Downloaded 198 times


Image


this is version 5(true to how gimp converts to grayscale mode, random colors)
Attachment:
AutoColorize.scm [4.39 KiB]
Downloaded 184 times

Image


this is version 6(based on wikipedia's coefficients of how to convert to gray scale)
Attachment:
AutoColorize.scm [4.44 KiB]
Downloaded 189 times

Image

_________________
TinT


Last edited by trandoductin on Fri May 29, 2015 4:34 pm, edited 1 time in total.

Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Fri May 29, 2015 12:46 pm  (#4) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
so for those that have tried all 5 versions
which one do you like best?
from the preview of my examples i think i like version 5 best.

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Fri May 29, 2015 6:44 pm  (#5) 
Offline
Global Moderator
User avatar

Joined: Oct 02, 2014
Posts: 4418
Location: Sydney Australia
Hello Trandoductin - thanks for the scripts, they keep coming at a hell of a rate :hehe

I do though have a question/observation for you - I ran my first AutoColourise with five colours ...

Image

... terrific outcome; so I repasted the owl into the same canvas and proceeded to run AutoColourise this time with ten colours ...

Image

... not such a good outcome; there are three layers ( ID by red dots) where the colour fills the canvas.

This type of outcome is repeatable so should I not rerun the script within the same canvas or is there perhaps a problem when I do?

_________________
Image

Respect should be offered freely but hard earned


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Fri May 29, 2015 7:37 pm  (#6) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
awesome glad you're trying it out.
I wouldn't recommend you trying to run the script again with different number of colors.
It apply changes to your original layer because it changes the color mode to indexed colors and back to RGB reducing the number of colors...it's best to control-Z the whole effect and try another number of colors (that's what i was doing when i was testing it).

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Fri May 29, 2015 9:30 pm  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
just playing with my script, i thought what if i use make visible layer from the colorization and use that as a layer of to play around with.
1. Original
Image
2. Result from running script
Image
3. Result when i use 2. as a layer on top (set to mode:Color) and opacity at 50%
Image
4. Result when I use 2. as a layer on top (set to mode:Soft Light) opacity 100%
Image

Here's another play.
1. Original
Image
2. Result from running script
Image
3. Result when use #2 as layer on top (set to mode: Soft Light)
Image

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 11:25 am  (#8) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
true to wikipedia calculations of gray scale but made a change so that it wouldn't take a long time on dark and bright colors (previous scripts did random colorization that took a long time on dark and bright colors because the chance of randomly hitting a really dark color is rare same as really bright ones).
version 6 (with fixed long delay bug on very dark/bright colors)
Attachment:
AutoColorize.scm [4.95 KiB]
Downloaded 208 times

_________________
TinT


Last edited by trandoductin on Sun May 31, 2015 9:32 am, edited 2 times in total.

Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 3:55 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Dec 26, 2014
Posts: 198
trandoductin wrote:
just playing with my script, i thought what if i use make visible layer from the colorization and use that as a layer of to play around with.
1. Original
[ Image ]
2. Result from running script
[ Image ]
3. Result when i use 2. as a layer on top (set to mode:Color) and opacity at 50%
[ Image ]
4. Result when I use 2. as a layer on top (set to mode:Soft Light) opacity 100%
[ Image ]

Here's another play.
1. Original
[ Image ]
2. Result from running script
[ Image ]
3. Result when use #2 as layer on top (set to mode: Soft Light)
[ Image ]

I like most of your renditions but particularly the first one of John Lennon. These look like interesting scripts but alas as I’m running gimp 2.6 on a 9 year old computer I can’t try them out, I really must get around to upgrading


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 4:32 pm  (#10) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
You should upgrade today. it takes like 5 minutes. :hehe

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 5:31 pm  (#11) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
I find it fun to apply this to existing paintings.
source image: https://www.facebook.com/AcrylicPaintingClub/photos/a.123636317799702.26645.118809331615734/458315690998428/?type=1&theater
Image

applied random colorization and used that as softlight layer
Image

another try at the black and white image of john lennon
Image


another painting source: https://www.facebook.com/AcrylicPaintingClub/photos/a.123636317799702.26645.118809331615734/458315674331763/
Image
applied colorization and softlit
Image

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 9:26 pm  (#12) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
auto-random colorize v.6
Image

Image
original photo by eveliddell

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


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 9:58 pm  (#13) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
only 5 colors...so modest.

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 10:19 pm  (#14) 
Offline
Global Moderator
User avatar

Joined: Oct 02, 2014
Posts: 4418
Location: Sydney Australia
Your scripts and their potential are intriguing me .. I got five separate images of our Circular Quay in Sydney starting from European settlement through to today, ran them all against V6 of your script using 10 colours, then assembled them as a collage.

Image

Then ran it through lighting effects with a bump ...

Image

Then ran it again with both bump and an e-map

Image

... so thank you again for these scripts and I have not yet had a real chance to play with the hatching versions.

_________________
Image

Respect should be offered freely but hard earned


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 10:23 pm  (#15) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
Very creative, nice result oldmangrumpy.

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


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sat May 30, 2015 10:29 pm  (#16) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
nice to see you're using it as part of your creative work.... collages are always cool.

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sun May 31, 2015 3:39 am  (#17) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5128
Location: Metro Vancouver, BC
trandoductin wrote:
only 5 colors...so modest.

:lol

I'm not an expert with scheme but shouldn’t the script be set to not alter all layers? If you duplicate a layer, select the new layer and run the script the original layer seems to get affected as well or am I daft (and I don't mean normally, although there is a good chance of that)?

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


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sun May 31, 2015 9:17 am  (#18) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
I think when I reduce down to like say 5 colors it does it to the whole image so i wouldn't know how to keep the active layer unchanged.

_________________
TinT


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sun May 31, 2015 10:08 am  (#19) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
a bypass of the problem could be USING A NEW IMAGE to perform the whole process

_________________
"Where am I ?"


Top
 Post subject: Re: simple auto-random colorize script
PostPosted: Sun May 31, 2015 11:06 am  (#20) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
okay so I made to create a new image instead of working on existing one. and added flatten new image option.

this is version 8
Attachment:
AutoColorize.scm [5.53 KiB]
Downloaded 115 times
\
It's moved to Script-Fu/Create New/Auto Colorize
Image

here's a sample run
1. original
Image
2. script created this (setting of 255 colors)
Image
3. used #2 as a soft-light layer on #1 (original)
Image
4. blurred soft-light layer
Image

_________________
TinT


Top
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Error with ICCII's Random Blends Script

6

No new posts G'Mic colorize interactive problem

2

No new posts GMIC colorize(interactive) achieve silver

1

No new posts Auto Installer

7

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

172



* Login  



Powered by phpBB3 © phpBB Group