forums

TNT Basic Forums > Programming Q&A
Colors
< Last Thread     Next Thread >
Author
Thread        Post A Reply

12-07-2005 20:17

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

Hello everyone,

I have a question: I want to make a image editor, and I want the image editor to be able to change the hue, saturation, and lightness of a pixel.

Hue can be from -180 to 180
---a red hue is 0
Saturation can be from 0 to 100
Lightness can be from 0 to 100

Got any ideas on how to do it?

12-07-2005 21:26

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Variations in colour space.

There are many ways to represent a colour on a computer, and TNT uses the most common, the RGB space. It's easy to convert this to CMYK (generally used in print), these two methods are referred to as the additive and subtractive spaces, but HSV is another matter. This is most commonly used (historically) as a way of describing 'alterations' to an existing space and came about through the invention of digital media retouching (a subject close to my heart, as you can probably tell). My honest advice... leave HSV alone, and if you have to include a totally different space then implement CMYK: C=!R, M=!G & Y=!B. K=!RGB...

Danny (nods)

12-08-2005 09:31

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

RGB -> HSV / HSL

Found this, if you really want to go ahead with the conversion, but be ready for some hairy maths calls...

http://www.tecgraf.puc-rio.br/~mgattass/color/RGBtoHSL.htm

Hope it helps.

Danny (nods)

12-08-2005 21:16

Posted by:
swagIT

Location:
Great Wet North (Vancouver)

Find more posts by swagIT

I Agree with Nods - spent my whole life working in pre-press from manul through to digital: we ONLY ever work in RGB or CMYK - mostly the latter as this is how we will image plates. Depends I guess on what your intention is for the image editor?

cheers

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.