How to apply relative color changes to multiple objects?

Post questions on how to use or achieve an effect in Inkscape.
toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

How to apply relative color changes to multiple objects?

Postby toxigames » Wed Jan 07, 2015 2:04 am

Say I have a number of objects, lets say 50 objects with different Lightness and I want to apply +10 to brightness to them all. Is this possible in Inkscape? If not I would think it a high priority. Well, at least for me it would save A LOT of time.

Example:
object 1: Lightness 50
object 2: Lightness 43
object 3: Lightness 67
Adding +10 Lightness to these objects in one action/one command would then change it to:
object 1: Lightness 50 + 10 = 60
object 2: Lightness 43 + 10 = 53
object 3: Lightness 67 + 10 = 77


Also, I am aware of Extensions -> Color -> 'Brighter', but that is a very slow way to increase brightness. Also 'Brighter' is increasing brightness by some preset value which seems to be sometimes a bit of +Saturation and some value +Lightness(not always the exact same amount(?)), and there is no where to change the incremental value. Even if there were it would seem a cumbersome way to do it, and, it is changing total brightness and not just Lightness. I am wondering why there is not just a slider function for adding values to objects attributes, just as there is a slider to change color attributes for HSL in the "Fill and Stroke" window?

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: How to apply relative color changes to multiple objects?

Postby hulf2012 » Wed Jan 07, 2015 2:30 am

Hello,

I was going to say to use the menu Extension > Color > Bright, but you don't have much control in it. Well, I'm using Inkscape 0.48 right now. Maybe in 0.91 that have been fixed (Maybe some one could check?).

In the Color extension sub-menu there is custom control, but it only uses RGB values. But as far i understand, Inkscape converts from/to RGB values to/from HSL.
http://tavmjong.free.fr/INKSCAPE/MANUAL ... lor-Custom

Since SVG files can be seen by text editors, a script program (like python) could change those values.
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: How to apply relative color changes to multiple objects?

Postby Lazur » Wed Jan 07, 2015 2:37 am

Hi.

According to http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Extensions-Color.html#Extensions-Color-MoreLight, more light extension adds 105% more brightness by default.
Probably it wouldn't take too much modification of the .py file, to increase that value.


Other than that, if all brightness values were more than 127, putting a white rectangle on top and changing its opacity would result something close.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: How to apply relative color changes to multiple objects?

Postby hulf2012 » Wed Jan 07, 2015 2:39 am

Ha ha,
you edited your message!
... anyway, please check mine anyway, the new version of inkscape, or a conversion from RGB to HSL (or other)

other idea: Filters can also be used.

Edit after Lazur response:
Oh well... just to increase the bet: you can control the SVG with CSS, but I haven't tried yet
No, it's not possible... in the way you want
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Wed Jan 07, 2015 6:11 am

hulf2012 wrote:Hello,

I was going to say to use the menu Extension > Color > Bright, but you don't have much control in it. Well, I'm using Inkscape 0.48 right now. Maybe in 0.91 that have been fixed (Maybe some one could check?).

In the Color extension sub-menu there is custom control, but it only uses RGB values. But as far i understand, Inkscape converts from/to RGB values to/from HSL.
http://tavmjong.free.fr/INKSCAPE/MANUAL ... lor-Custom

Since SVG files can be seen by text editors, a script program (like python) could change those values.


I use 0.48; I should have written that to begin with of course. Yes unfortunately 'Brighter' extension is a bit cumbersome to use. However it's still useful enough; I am using it now and it get's the job done, just.. not very quickly. But I believe that from the current possibilities that is what I will go with. I'd still much prefer a sliding function, would be much more intuitive.

I'd wish I was able to program extensions, I'd make a sliding function to add HSL values right on the spot :)

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: How to apply relative color changes to multiple objects?

Postby Maestral » Wed Jan 07, 2015 7:50 am

You might get the desired result with the Filters/Color/Lightness-Contrast and then, in Filter editor, adjust the flood color to black, white, gray or even some other color. Individual settings for each object will be preserved.
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: How to apply relative color changes to multiple objects?

Postby ragstian » Wed Jan 07, 2015 8:58 am

Hi

Quote from the filter-master! - Maestral,
You might get the desired result with the Filters/Color/Lightness-Contrast


Using the filter does not change the "original" SVG?

To make an extension with a slider is relatively simple, why is a slider "more productive" than a number input?
(You can have both!)

Let's fire up the text editor and start coding - the race is on!

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

User avatar
Maestral
Posts: 982
Joined: Sat Aug 27, 2011 7:10 am

Re: How to apply relative color changes to multiple objects?

Postby Maestral » Wed Jan 07, 2015 8:03 pm

ragstian wrote:Quote from the filter-master!

It`s an honor to share these pages with you
:tool_zoom: <<< click! - but, those with a cheaper tickets should go this way >>> :!:

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Thu Jan 08, 2015 8:34 am

ragstian wrote:Hi

Quote from the filter-master! - Maestral,
You might get the desired result with the Filters/Color/Lightness-Contrast


Using the filter does not change the "original" SVG?

To make an extension with a slider is relatively simple, why is a slider "more productive" than a number input?
(You can have both!)

Let's fire up the text editor and start coding - the race is on!

RGDS
Ragnar


I guess it would only be more productive if the changes would happen almost realtime. The 'Brighter' extension takes several seconds to apply some saturation and lightness to even a small number of objects and that is perhaps my biggest problem and I find that a bit odd? Just adding lightness or saturation to one simple non grouped object is very very quickly done with the HSL slider. Why is the 'Brighter' extension then so slow?

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: How to apply relative color changes to multiple objects?

Postby ragstian » Thu Jan 08, 2015 12:35 pm

Hi

All the extensions use a program external to Inkscape. Most extensions that follow Inkscape are written in Python.
When you "start" an extension the Python interpreter has to be started,
the interpreter loads the extension code, the code is then excecuted.

Most of the "delay" you see is most likely from the start & load.
My extension (with slider) works just as slow as the original brighten extension.
Image

No point in "releasing" the extension if speed is your ultimate goal.

Might be an idéa to submit a "feature request" to the development team?

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Fri Jan 09, 2015 8:25 am

ragstian wrote:Hi

All the extensions use a program external to Inkscape. Most extensions that follow Inkscape are written in Python.
When you "start" an extension the Python interpreter has to be started,
the interpreter loads the extension code, the code is then excecuted.

Most of the "delay" you see is most likely from the start & load.
My extension (with slider) works just as slow as the original brighten extension.

No point in "releasing" the extension if speed is your ultimate goal.

Might be an idéa to submit a "feature request" to the development team?

RGDS
Ragnar


I see. Yes, I really think this should be a feature built in Inkscape. I find it hard to believe that adding brightness and saturation to multiple differently colored objects is not a common task? It's very common for me figuring out the correct color matching for objects.

Thank you for you help btw :)

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Thu Jan 29, 2015 5:58 am

ragstian wrote:Hi

All the extensions use a program external to Inkscape. Most extensions that follow Inkscape are written in Python.
When you "start" an extension the Python interpreter has to be started,
the interpreter loads the extension code, the code is then excecuted.

Most of the "delay" you see is most likely from the start & load.
My extension (with slider) works just as slow as the original brighten extension.
Image

No point in "releasing" the extension if speed is your ultimate goal.

Might be an idéa to submit a "feature request" to the development team?

RGDS
Ragnar


Hi Ragnar, did you by chance ever finished that extension? Or add a way to also increase/decrease saturation and hue? If so I think it would be hugely useful to control how much to increase/decrease with those percentages just as you showed in the screenshot.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: How to apply relative color changes to multiple objects?

Postby ragstian » Thu Jan 29, 2015 6:40 am

Hi.

The extension is working but I would have to "tidy up" the code before I release it.
( I am not a programmer! )
If you would find this extension useful I will do so.

Stay tuned.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Fri Jan 30, 2015 4:24 am

ragstian wrote:Hi.

The extension is working but I would have to "tidy up" the code before I release it.
( I am not a programmer! )
If you would find this extension useful I will do so.

Stay tuned.

RGDS
Ragnar


Awesome that you would take the time to do that, thank you very much! I would find it very useful. I often find myself using the more/less hue/saturation darker/brighter functions. But the step is to large. So for example a brown color becomes red when using less hue. With lesser increments I can tweak the colors much easier.

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: How to apply relative color changes to multiple objects?

Postby ragstian » Mon Feb 02, 2015 3:46 am

Hi.

Have you tried the 0.91's Extension - Color - HSL adjust?
It works on all selected objects and seems to do the same as my extension.

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Tue Feb 03, 2015 7:34 am

ragstian wrote:Hi.

Have you tried the 0.91's Extension - Color - HSL adjust?
It works on all selected objects and seems to do the same as my extension.

RGDS
Ragnar


No I haven't. I wasnt even aware there was an Inkscape version 0.91, but now I know lol. I will try it out to see, thank you very much! :D

User avatar
ragstian
Posts: 1181
Joined: Thu Oct 11, 2012 2:44 am
Location: Stavanger-Norway

Re: How to apply relative color changes to multiple objects?

Postby ragstian » Tue Feb 03, 2015 7:51 am

Hi.
toxigames wrote: I wasn't even aware there was an Inkscape version 0.91

You're not visiting the forum frequently enough! :)

RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: How to apply relative color changes to multiple objects?

Postby toxigames » Tue Feb 03, 2015 8:11 am

ragstian wrote:Hi.
toxigames wrote: I wasn't even aware there was an Inkscape version 0.91

You're not visiting the forum frequently enough! :)

RGDS
Ragnar


You're absolutely right ;) Thanks for the help! :D


Return to “Help with using Inkscape”