[CREATE] Questions and reflections about gradients

Carlos López González genetita at gmail.com
Mon Nov 8 08:49:36 PST 2010


Hi,
Working with Synfig Project here http://synfig.org

I've been reading the latest discussion about gradient format
and I do agree on define the gradient as this:

A Color Gradient is a collection of Stop Points with the following
information:
-Color definition (inlcuded alpha).
-Position (between 0 and 1)
-Math formula to move from this stop point to the next

If there is need of have a separated alpha gradient just replace the Color
definition
item by the Alpha definition item and add it as optional. The application
should know
what to do with that Alpha Gradient once loaded.

Let's look into each component:

*Color definition: it has to include one of the standard of the color
definitions
 (RGB, CMYK, HSV, etc) and all the information needed. Usually all the
colors should be
defined in the same color model and it (the model specification) should be
included in the
gradient format if not part of a common standard.

* Position: it just can be defined with a real number between [0.0, 1.0]

* Math Formula: The agreement of this part is important for the current
existing gradients.
Most of the applications uses just the linear approaching but to completely
agree this item
it is needed that, each application that has non linear interpolation
between one stop and
the other, compare its most complex interpolation system to be sure that it
can be emulated
by the proposed general formula.

Currently Synfig uses Color Gradients with the following approaching:
-Color definition: RGBA color
-Position: a real number
and no interpolation data, just linear interpolation.

Here a simple red to black gradient definition for Synfig:

<gradient>
    <color pos="0.000000">
          <r>1.000000</r>
          <g>0.000000</g>
          <b>0.000000</b>
          <a>1.000000</a>
    </color>
    <color pos="1.000000">
          <r>0.000000</r>
          <g>0.000000</g>
          <b>0.000000</b>
          <a>1.000000</a>
    </color>
</gradient>

Greetings

Carlos López
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/create/attachments/20101108/a5e31214/attachment.htm>


More information about the CREATE mailing list