CompuServe Thread

#HSI to RGB to HSI

8 messages in this thread
#56198From: Steve FaiwiszewskiJul 7, 1989 11:16 PM
Which issue of AC has the info about HSI <–> RGB conversion? I, too, am looking for something like that. – Steve –
#56208From: ROBERT SALESASJul 8, 1989 1:28 AM
Hmmm… I wish I knew!!! You see I jus t had the program that cam with it. The problem I found is that the program shows how to do HSI -> RGB but NOT HSV -> RGB which is what most programs use. Don't worry, I've written one that does! Also I'm just finishing the RGB -> HSV! It will hopefully be ready in 3 – 4 days (my girlfriend is just finishing some touches on the formula!) then I'll clean the code up and post it for those that need it. Don't forget though, I use Modula-2 and LongIntes.
#56227From: M2S/Phil CampJul 8, 1989 7:22 AM
Great! I remember using Deluxe Paint to ceck out if my math was being done correctly. Does yours match up with DPaint?
#56276From: ROBERT SALESASJul 8, 1989 1:07 PM
He he! I guess we work alike! I checked with DPaintIII and with Pixmate since Pixmate doesn't do immediate conversion but rather toggle. Just in case it affected it in the end. Even though I'm using integers it doesn't seem to have any serious deterioration on the final output. Although I wouldn't recommend it for a palette of 256 possible combinations or more.
#56331From: Steve FaiwiszewskiJul 8, 1989 9:51 PM
Modula-2 is fine by me, Robert. I've written many Modula-2 articles for AC in the past. Waiting to see your code … – Steve –
#56351From: ROBERT SALESASJul 9, 1989 12:34 AM
Hmm… Steve, I'm sorry to dissappoint you but I have some MAJOR problems. Although it is possible and simple enough to get HSV to RGB, RGB to HSV seems to be a tad TOO difficult. Saturation and Value go correctly enough, but hue needs more accuracy than I can possibly achieve view an integer. I'll give it one more try tomorrow, and if not I'll upload it as is for you. In anycase I'll rewrite it using REALs since I really feel that having HSV is worth the extra bits of the Real libraries.
#56236From: Steve PietrowiczJul 8, 1989 8:32 AM
That issue would be Volume 1 issue 5. (I wrote that article). It's in AmigaBasic (the only language I had at the time), but it should be pretty easy to follow. Steve
#56332From: Steve FaiwiszewskiJul 8, 1989 9:51 PM
Thanks for the info, Steve. – Steve –