Spectra (Spectra256)
Spectra (Spectra256)
It's a small gradient creator/editor I wrote in python a few years ago.
I have made a few minor corrections. Only "map" gradients are supported.
http://rosros-3.deviantart.com/art/Spectra256-252042986
Inkscape can import gimp gradients (ggr). I wrote most of the code for ggr export,
and I might add this to Spectra256.
HTH
I have made a few minor corrections. Only "map" gradients are supported.
http://rosros-3.deviantart.com/art/Spectra256-252042986
Inkscape can import gimp gradients (ggr). I wrote most of the code for ggr export,
and I might add this to Spectra256.
HTH
Re: Spectra (Spectra256)
That would make it an interesting helper tool for Inkscape :)rosros wrote:I wrote most of the code for ggr export, and I might add this to Spectra256.
(BTW - the default INI file for linux in the archive has the wrong name and can't be found by Spectra256a.pyw
Code: Select all
$ python -V
Python 2.6.7
$ python Spectra256a.pyw
Traceback (most recent call last):
File "Spectra256a.pyw", line 910, in <module>
myapp = MyApp()
File "Spectra256a.pyw", line 115, in __init__
inifile = open(os.getcwd() + os.sep + "spectra256-linux.ini")
IOError: [Errno 2] No such file or directory: '/tmp/test/spectra256_by_rosros_3-d4625m2/spectra256-linux.ini'
$
Code: Select all
$ cp spectra255-linux.ini spectra256-linux.ini
Re: Spectra (Spectra256)
From the Help text:
Admittedly, I didn't spend much time searching - any hints where to find the mentioned examples of formulas for gradient maps?3. GENERATION AND EDITING OF GRADIENTS
Any well-formed formula (in Python) is acceptable;
the main parameters/variables to be used are:
yR the red color component, integer from 0 to 255
yG the green color component, integer from 0 to 255
yB the blue color component, integer from 0 to 255
x the "step" of the gradient, from 0 to 255
Many example formulas are provided.
Re: Spectra (Spectra256)
I have added a few formulas and gradients. The program should work with minor corrections on all systems that run python;
I have only WXP and Linux for testing.
I have only WXP and Linux for testing.
Re: Spectra (Spectra256)
Thx - much appreciated :)rosros wrote:I have added a few formulas and gradients.
Re: Spectra (Spectra256)
I have added the code to support the ggr format; which is now available both for import and for export (opening and saving).
The internal representation of the gradient is a list of 256 4-color (RGBA) tuples; when saving to 'map' the A component is discarded. When saving to ggr, there is a limited amount of simplification (in order to avoid having always 256-segment ggr gradients); unwanted nodes can be deleted on inkscape canvas too.
The internal representation of the gradient is a list of 256 4-color (RGBA) tuples; when saving to 'map' the A component is discarded. When saving to ggr, there is a limited amount of simplification (in order to avoid having always 256-segment ggr gradients); unwanted nodes can be deleted on inkscape canvas too.
Re: Spectra (Spectra256)
Having trouble getting the latest version to work properly: loaded formulas do not auto-update (some of the provided samples in 'formulas255' seem to completely fail, some can be updated by reselecting the RGB colorspace; HSV colorspace completely fails with an error message [1]) - using python 2.6.7 on Mac OS X 10.5.8 (started on the command line with 'python Spectra256c.pyw').
[1]error message when selecting HSV from the 'Color Space' menu:
[1]error message when selecting HSV from the 'Color Space' menu:
Code: Select all
$ python --version
Python 2.6.7
$ python Spectra256c.pyw
Exception in Tkinter callback
Traceback (most recent call last):
File "/Volumes/green/mp-inkscape/with-a-long-long-long-directory-name/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk/Tkinter.py", line 1410, in __call__
return self.func(*args)
File "Spectra256c.pyw", line 489, in colorspaceHSV
self.updateScreen()
File "Spectra256c.pyw", line 1004, in updateScreen
rdpoint0, grpoint0, blpoint0 = rgb_to_hsv(rd/255.0, gr/255.0, bl/255.0)
NameError: global name 'rgb_to_hsv' is not defined
Re: Spectra (Spectra256)
I have fixed the 'rgb_to_hsv' matter and also checked some formulas. It now works correctly in my systems (Linux and WXP).
Re: Spectra (Spectra256)
Now the svg gradient import works (in version 20110823); one can save an Inkscape gradient in ggr format for use in The Gimp (or for re-import in Inkscape).
Spectra V. 20130513
Main updates:
User:
Colorspaces: RGB, HSV, RYB (Itten's), CMY, CMYK
Palettes: generation and modification, new formulas for
generation (complementary, triadic and tetradic), HTML color
chart generation, sorting of colors
Palettes and gradients: saving with 'colordistance' to reduce
the number of colors.
Programming:
Removed class structure, changed geometry manager to
tkinter pack, removed dependencies.
https://sourceforge.net/projects/spectrag/
rosros
User:
Colorspaces: RGB, HSV, RYB (Itten's), CMY, CMYK
Palettes: generation and modification, new formulas for
generation (complementary, triadic and tetradic), HTML color
chart generation, sorting of colors
Palettes and gradients: saving with 'colordistance' to reduce
the number of colors.
Programming:
Removed class structure, changed geometry manager to
tkinter pack, removed dependencies.
https://sourceforge.net/projects/spectrag/
rosros
Re: Spectra (Spectra256)
Looks interesting, haven't checked this topic before.
How can non-linear gimp gradients be exported to inkscape's svg ones?
How can non-linear gimp gradients be exported to inkscape's svg ones?
Re: Spectra (Spectra256)
If color segments are linear only in svg gradients, one could save the gradient in Spectra
as a map gradient (255 nodes), then open it and re-save it as Gimp gradient for
direct drag and drop on Inkscape canvas.
The number of steps (nodes) can be reduced by increasing the colordistance.
rosros
as a map gradient (255 nodes), then open it and re-save it as Gimp gradient for
direct drag and drop on Inkscape canvas.
The number of steps (nodes) can be reduced by increasing the colordistance.
rosros
Re: Spectra (Spectra256)
I was thinking for the opposite way.
Svg allows linear interpolation between colours, but in gimp there are options of others.
There was a small discussion on that:
http://www.inkscapeforum.com/viewtopic.php" onclick="readonly();return false;"download/file822c.png" class="postimage" alt="Image" />
Svg allows linear interpolation between colours, but in gimp there are options of others.
There was a small discussion on that:
http://www.inkscapeforum.com/viewtopic.php" onclick="readonly();return false;"download/file822c.png" class="postimage" alt="Image" />
Not that I found where that menu was in gimp, but I would draw gradients to add some depth to the objects, like, on these cylinders: