POV-Ray : Newsgroups : povray.newusers : conversion Server Time17 Aug 2022 20:36:48 EDT (-0400)
 conversion (Message 1 to 3 of 3)
 From: David Kraics Subject: conversion Date: 3 Aug 2022 12:55:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.62eaa74abd9127441c1b6180a57e0%40news.povray.org",
"headline": "conversion",
"dateCreated": "2022-08-03T16:55:00+00:00",
"datePublished": "2022-08-03T16:55:00+00:00",
"author": {
"@type": "Person",
"name": "David Kraics"
}
}
How do I convert from the 255 scale rgb numbers to decimal numbers used by
POV-Ray? Apparently dividing the number by 255 doesn't work.
```
 From: Alain Martel Subject: Re: conversion Date: 4 Aug 2022 07:15:21 Message: <62ebaa49\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#62ebaa49%241%40news.povray.org",
"headline": "Re: conversion",
"dateCreated": "2022-08-04T11:15:21+00:00",
"datePublished": "2022-08-04T11:15:21+00:00",
"author": {
"@type": "Person",
"name": "Alain Martel"
}
}
Le 2022-08-03 à 12:50, David Kraics a écrit :
> How do I convert from the 255 scale rgb numbers to decimal numbers used by
> POV-Ray? Apparently dividing the number by 255 doesn't work.
>

Normally, 0..255 scale rgb values are in the sRGB space.
To use them, you need to do this :
1) In the global_settings block, set assumed_gamma 1
2) In your pigment, use srgb instead of just rgb.

When you use rgb, POV-Ray use linear range.
When you use srgb, POV-Ray use the sRGB tranfert formula to convert the
non-linear ranges of the sRGB colour space into the linear range of the
rgb colour space.

The format is :

pigment{ srgb sRGB_Colour/255 }
```
 From: kurtz le pirate Subject: Re: conversion Date: 5 Aug 2022 13:19:32 Message: <62ed5124\$1@news.povray.org>
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#62ed5124%241%40news.povray.org",
"headline": "Re: conversion",
"dateCreated": "2022-08-05T17:19:32+00:00",
"datePublished": "2022-08-05T17:19:32+00:00",
"author": {
"@type": "Person",
"name": "kurtz le pirate"
}
}
On 03/08/2022 18:50, David Kraics wrote:
> How do I convert from the 255 scale rgb numbers to decimal numbers used by
> POV-Ray? Apparently dividing the number by 255 doesn't work.
>

What do you mean by "number" ?

Alain answered precisely and we can add that :
if c = red 0..255 green 0..255 blue 0..255, then the division of c/255
will give well the color with the values between 0.0 and 1.0.

And "pigment { color c }" will be interpreted correctly by POVRay

--
Kurtz le pirate
Compagnie de la Banquise
```