It is currently Thu Jul 04, 2024 5:25 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 7:04 am  (#1) 
Offline
GimpChat Member

Joined: Mar 11, 2016
Posts: 9
I made a Python plugin that analyses the hue/saturation values used in an image and displays them on a colour wheel:

Image

Not as pretty as some of the other scripts here, but maybe of use to some. ;)

You can download the plugin from github where I also put up more detailed instructions.

Code-wise, I'm not completely happy with my little gimpfu import hack for the unit tests, but the proper way – putting the gimp-independent functions in a separate file – would have been more of a hassle for the users.


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: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 8:38 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Hi Rebecca.

This is the only information (output color wheel) - is there any practical use?


Attachments:
Output colour wheel.png
Output colour wheel.png [ 347.87 KiB | Viewed 4688 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 11:37 am  (#3) 
Offline
GimpChat Member

Joined: Mar 11, 2016
Posts: 9
Yes, that's the only information the plugin produces.

The idea is that you can "reverse engineer" existing pieces of art and see what colours were used in them. What colours to choose for your art (be it painting, digital art, photo, movie etc) is an important decision to make – you don't always want to use the full range of colours available, but rather limit your palette to achieve harmonic results or specific moods.

I'm currently reading "Color and Light" by James Gurney, who describes limited palettes and gives examples by placing geometrical masks called gamut masks on a colour wheel. He's also made a couple of blog posts about it. That's what inspired me to make this plugin so that I can inspect the colour wheel distribution of various things.

Of course, it doesn't really help you if you want to paint something from scratch, for that, you need to have something that limits your palette. MyPaint lets you set gamut masks on the colour wheel, and it has an export to GIMP palette option, but I paint in MyPaint anyway, so I haven't tried the export.

For example, to paint something like my example above with the yellow trees, I could use a mask like this:

Image

Quite interesting that a random snaphot I took turns out to have almost a perfect triangular gamut mask like right out of a textbook. ;) Your expample, too, has a very limited palette that's almost triangular.


Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 11:56 am  (#4) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4003
Location: Canada
I was wondering about the color wheel formula?
Like I wonder if it's good way of replacing colors like rotating colors...
Where you have your colors mapped to a position on a circle now...
What if you had 2 pictures...and then you'd replace one color at a time based on distance from center and angle so that you can replace one picture's color with another... I am just thinking out loud not sure how I would do it.

_________________
TinT


Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 12:10 pm  (#5) 
Offline
GimpChat Member

Joined: Mar 11, 2016
Posts: 9
The colour wheel is based on the hue, saturation, lightness (HSL) notation of colours, rather than RGB. Hue is the angle in the wheel, saturation is the distance from center (the most desaturated in the center, the most saturated on the out-most circle). Lightness (amount of white) is not displayed on the wheel.

GIMP has a couple of stuff under the "Color" menu that let you change those values on an existing image, like "Adjust Hue/Lightness/Saturation".


Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 12:34 pm  (#6) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4003
Location: Canada
Maybe i can use your script then
use rotate colors to do what i want.

_________________
TinT


Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 12:40 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
This is what i was thinking the plug-in could be used for. Fixing off color photos of the same subject. Say you take a picture of a person in a different lighting situation and want to create the same lighting in another photo of the same subject material. Just a thought. As we all well know different lighting types and shades create different colors from the same image.

_________________
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: Python Plugin: Colourwheel Analysis
PostPosted: Sat Mar 12, 2016 8:09 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697

Rod wrote:
This is what i was thinking the plug-in could be used for. Fixing off color photos of the same subject. Say you take a picture of a person in a different lighting situation and want to create the same lighting in another photo of the same subject material. Just a thought. As we all well know different lighting types and shades create different colors from the same image.


That is what I wrote my histogram match script to automate!

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sun Mar 13, 2016 1:47 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Rob, thanks for recalling it.
It's really wonderful.
Here a quick (and not optimized example, only to show):
a) source image
Attachment:
DSCF1060_base.jpg
DSCF1060_base.jpg [ 145.38 KiB | Viewed 4565 times ]

b) image to modify
Attachment:
DSCF1339.JPG
DSCF1339.JPG [ 1.75 MiB | Viewed 4565 times ]


see in the next post what can be obtained...

_________________
"Where am I ?"


Top
 Post subject: Re: Python Plugin: Colourwheel Analysis
PostPosted: Sun Mar 13, 2016 1:51 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
using HSV
Attachment:
DSCF1339-HSV.JPG
DSCF1339-HSV.JPG [ 2.01 MiB | Viewed 4564 times ]


using LAB
Attachment:
DSCF1339-LAB.JPG
DSCF1339-LAB.JPG [ 2.14 MiB | Viewed 4564 times ]


note that this is an EXTREME test, done QUICKLY and without any further OPTIMIZATION.
Wonderful script !

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Convert GIMP plugin from Python 2 to Python 3

4

No new posts Attachment(s) Macbook User and Python plugin

14

No new posts Unable to get simple python plugin to show up

8

No new posts Please make a python plugin to combine my GEGL filters with GMIC

1

No new posts Get a mouse click or select a pixel in an image in a python plugin?

3



* Login  



Powered by phpBB3 © phpBB Group