[geeks] fti to svg conversion

Joshua D Boyd jdboyd at cs.millersville.edu
Tue Oct 29 22:30:20 CST 2002


On Tue, Oct 29, 2002 at 11:17:11PM -0500, Caleb Shay wrote:

>  Does .svg
> > require it?  I'm looking at the definition, and they say that all colors
> > are in SRGB color space, but the link to what SRGB means is broken.  I
> > found other references to it, but alas, it relies on know more color
> > theory that I can wade through at the moment (I'm tired and everything
> > is starting to blur for me), but it seems that it is true color.
> > 
> > If it were me, after seperating $c1 and $c2 from $color, I'd convert
> > them both to RGB, then blend those together, as well as converting
> > $color=>0 to RGB as well, and make the resulting .svg truecolor rather
> > than indexed color, if possible.
> 
> Ah, if only I had ANY idea how you are supposed to blend 2 RGB colors. 
> Probably insanely simple, but I don't know how to do it.

Once in RGB space, say you have a blending factor 0<B<1;
Rn = R1 * B + R2 * (1-B)
Gn = G1 * B + G2 * (1-B)
Bn = B1 * B + B2 * (1-B)

In RGBA space you either do the same, or you do
Rn = R1* A1 + R2 * A2
Gn = G1* A1 + G2 * A2
Bn = B1* A1 + B2 * A2

I think for this you probably want method one though.
 
> > Actually, I can think of one other thing to try.  Write a sample FLTK
> > program to load and display .fti files using it's built in .fti load,
> > and see if those display correctly.
> 
> Except that I still don't know C, so I probably wouldn't get very far
> with that.  I keep meaning to learn C, but I've never been able to get
> myself much further than hello world before confusion or boredom kicks
> in.

Hmm.  And here I thought your only said you weren't a C wizard.  OK.
Though, I believe that FLTK can be programed from language other than
C.  Like say Python or Perl, as in here: http://pyfltk.sourceforge.net/ 

-- 
Joshua D. Boyd



More information about the geeks mailing list