[mapserver-users] hue, saturation, value -> RGB

Hankley, Chip Chip.Hankley at GASAI.Com
Wed Jun 5 13:58:42 EDT 2002


Unfortunately they are built in functions that do the RGB<->HSV conversions.
I've never tried this, but you might be able to manually convert the values
from the ArcView flavor of HSV to the Photoshop flavor of HSV.

So, for instance, in PS (and strangely ArcInfo...why they didn't use the
same color model is beyond me) H is 0-360, and S and V are both 0 to 100.

So, say you have an AV HSV color specified as 255 255 255

This should be equivalent to a PS value of 
  H: 360 (or 0)
  S: 100
  V: 100

Your formula for the conversion should be:

  H_PS = (H_AV / 255) * 360
  S_PS = (S_AV / 255) * 100
  V_PS = (V_AV / 255) * 100

where H_PS is the HUE value in Photoshop, and H_AV is the HUE value in
ArcView, and so on.

If you've got a long list, you could do all the conversions in a
spreadsheet, then move over to PS.

Hope that helps!

Chip

-----Original Message-----
From: Pushkar Pradhan [mailto:pushkar at ERC.MsState.Edu]
Sent: Wednesday, June 05, 2002 12:40 PM
To: Hankley, Chip
Cc: mapserver-users at lists.gis.umn.edu
Subject: RE: [mapserver-users] hue, saturation, value -> RGB


Thanks to everybody,
I did it in photoshop, that exe program, but as Chip has said the Arcview
values of H,S and V are different, thus most programs won't let me use a
Saturation value of 255 etc.
Are these avenue scripts inbuilt in arcview, can anybody point out how to
use them to do conversion.
> As Stephen pointed out, there are some good formulas via the Google search
> page that you can wade through to figure it out...
>
> However, some words of caution.
>
> The way ArcView calculates HSV is a little different. Values for H, S, and
V
> all range from 0 to 255 (I believe). This is different from other HSV
color
> models. If you have access to ArcView, there are some simple avenue
scripts
> that will do the conversion for you (or you might be able to get your
client
> to do it).
>
> Chip
>
> -----Original Message-----
> From: Stephen Woodbridge [mailto:woodbri at swoodbridge.com]
> Sent: Wednesday, June 05, 2002 4:57 AM
> To: Pushkar Pradhan
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [mapserver-users] hue, saturation, value -> RGB
>
>
> http://www.google.com/search?hl=en&q=hsv+to+rgb&btnG=Google+Search
>
> Pushkar Pradhan wrote:
> >
> > Hi,
> > I have a client who has given me the color hue, saturation and value
> > attributes for each shapefile. He got these values from arcview's legend
> > table. Doesn anyone know how to translate these values to  pure R, G and
B
> > so that mapserver can understand it?
> > Thanks,
> >
> > -Pushkar S. Pradhan
>

-Pushkar S. Pradhan



More information about the mapserver-users mailing list