Comment 14 for bug 979208

Revision history for this message
su_v (suv-lp) wrote :

Kryo Stat wrote:
> Do you think it would be possible to include Brightness-Contrast and Color
> Levels/Curves in this module since this all deals with color adjustments ?

If you know how to code this in python, based on the RGB values used in the style properties of the selected vector objects, (or know links to code snippets or sample python-based implementations), I could imagine that some additional basic types of (not color-managed) adjustments could be added. Better though would be an internal implementation as mentioned in bug #171589 - the extensions are essentially just placeholders (IMHO):
- Extensions are external (python) scripts, and run in a separately spawned process which doesn't have access to internal functions of Inkscape.
- In the context of Inkscape's current extension system, these scripts cannot use fancy widgets for interactive GUI color adjustments.

For now, I'm attaching a variant of the 'HSL Adjust' extension which uses Python's 'colorsys' module [1] for all color conversions, and allows adjustments in either HLS or HSV color notation [2] (conversions are based on the RGB values as stored in the SVG source). The options to randomize the values have been dropped (for now). Note that I didn't run extensive tests, and that 'HSV' was added simply because it's readily available in a default python module (I'm not an expert wrt to color operations myself).
Maybe HSV is closer to what you had been looking for (at least wrt to Lightness/Brightness)?

> Maybe later expand it even more to include colorize and other possible color
> adjustment operations ?

You did explore the rest of the currently available color extension modules?
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Extensions-Color.html>

---
[1] <http://docs.python.org/2/library/colorsys.html>
[2] <http://en.wikipedia.org/wiki/HSL_and_HSV>