Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Color depth - Wikipedia, the free encyclopedia

8 views
Skip to first unread message

Roger Bagula

unread,
Nov 22, 2009, 6:16:17 AM11/22/09
to
http://en.wikipedia.org/wiki/Color_depth

Does anyone know how to access thousand and millions of
colors in Mathematica?

Respectfully, Roger L. Bagula
11759 Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :
http://www.google.com/profiles/Roger.Bagula
alternative email: roger....@gmail.com

dh

unread,
Nov 23, 2009, 6:52:45 AM11/23/09
to

Roger Bagula wrote:

> http://en.wikipedia.org/wiki/Color_depth

>

> colors in Mathematica?

>

> Respectfully, Roger L. Bagula

> http://www.google.com/profiles/Roger.Bagula

> alternative email: roger....@gmail.com

>

>

>

Hi Roger,

as Mathematica can calculate with real double precision numbers, the

number of colors is presumably restricted by your graphics card and

monitor and not by Mathematica.

See e.g. RGBColor.

Daniel

Bill Rowe

unread,
Nov 23, 2009, 6:54:56 AM11/23/09
to
On 11/22/09 at 6:11 AM, rlba...@sbcglobal.net (Roger Bagula) wrote:

>http://en.wikipedia.org/wiki/Color_depth

>Does anyone know how to access thousand and millions of colors in
>Mathematica?

In Mathematica, color (RGBColor) is determined by a set of three
to four real values from 0 to 1. The fourth value is the alpha
channel (opacity) and defaults to 1 when only r,g,b values are given.

=46or millions of colors, each channel is normally represented as
an 8-bit value. So, here is an example of converting a
Mathematica RGBColor to 8-bits per channel

In[4]:= Round[255 List @@ ColorData[1][1]]

Out[4]= {63,61,153}

This particular color is the default color used by Plot and
ListPlot when plotting a single curve or data set.


Sjoerd C. de Vries

unread,
Nov 23, 2009, 6:57:58 AM11/23/09
to
This looks like a troll or I am missing something here? For someone
who has been around for a while I cannot imagine that you haven't been
working with colors before.

Manipulate[
Graphics[{RGBColor[r, g, b], Disk[]}], {r, 0, 1, 1/256}, {g, 0, 1,
1/256}, {b, 0, 1, 1/256}]

Cheers -- Sjoerd

On Nov 22, 1:16 pm, Roger Bagula <rlbag...@sbcglobal.net> wrote:
> http://en.wikipedia.org/wiki/Color_depth
>
> Does anyone know how to access thousand and millions of
> colors in Mathematica?
>
> Respectfully, Roger L. Bagula

> 11759 Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :http://www=
.google.com/profiles/Roger.Bagula
> alternative email: roger.bag...@gmail.com


DrMajorBob

unread,
Nov 24, 2009, 5:51:38 AM11/24/09
to
Perhaps your imagination is lacking; I've been around for a while, I
think, yet I (still) have no answer to Roger's post.

There's nothing in your Manipulate (or in Help for RGBColor) to indicate
the number of colors available.

Just because you've stepped your controls in units of 1/256 doesn't mean
the unit matters to RGBColor.

Bobby

On Mon, 23 Nov 2009 05:48:46 -0600, Sjoerd C. de Vries
<sjoerd.c...@gmail.com> wrote:

> This looks like a troll or I am missing something here? For someone
> who has been around for a while I cannot imagine that you haven't been
> working with colors before.
>
> Manipulate[
> Graphics[{RGBColor[r, g, b], Disk[]}], {r, 0, 1, 1/256}, {g, 0, 1,
> 1/256}, {b, 0, 1, 1/256}]
>
> Cheers -- Sjoerd
>
> On Nov 22, 1:16 pm, Roger Bagula <rlbag...@sbcglobal.net> wrote:

>> http://en.wikipedia.org/wiki/Color_depth
>>
>> Does anyone know how to access thousand and millions of
>> colors in Mathematica?
>>
>> Respectfully, Roger L. Bagula
>> 11759 Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814


--
DrMaj...@yahoo.com

Patrick Scheibe

unread,
Nov 25, 2009, 2:32:01 AM11/25/09
to
Hi,

assume the following graphic in Mathematica

With[{n = 4^2},
ArrayFlatten[
Partition[
Table[{x, y, z}, {z, 0, 1, 1/(n - 1)}, {y, 0, 1, 1/(n - 1)}, {x,
0, 1, 1/(n - 1)}], Sqrt[n]]]] //
ArrayPlot[#, ColorFunction -> RGBColor] &

when you check the values for the colors in this image you'll see that
every pixel has different rgb-values. This means if you put n=16^2 you
would have 256x256x256 colors in the image which is exactly what
"millions of colors" is supposed to be.
Since the table creates rational expressions for the {r,g,b} colors you
could easily (with the restriction that an image of that size would take
too long to render in Mathematica) create more colors by setting higher
values to n.

But what does this mean? Are there really that many visible colors on
your screen? What happens if you export the image?
This depends many things, e.g. on your os-settings.

So if you really want to know more, you have to tell more about what you
try to achieve and which things are not working for you.

Cheers
Patrick

On Sun, 2009-11-22 at 06:11 -0500, Roger Bagula wrote:
> http://en.wikipedia.org/wiki/Color_depth
>
> Does anyone know how to access thousand and millions of
> colors in Mathematica?
>
> Respectfully, Roger L. Bagula
> 11759 Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :

> http://www.google.com/profiles/Roger.Bagula
> alternative email: roger....@gmail.com
>
>
>


DrMajorBob

unread,
Nov 25, 2009, 11:02:41 PM11/25/09
to
That definitely answers the question, I'd say.

And you're right, my apologies... I stopped reading too soon, or stopped
paying attention.

(Sometimes it's "Short Attention-Span Theater", here.)

Bobby

On Wed, 25 Nov 2009 17:42:21 -0600, Patrick Scheibe
<psch...@trm.uni-leipzig.de> wrote:

> Hi,
>
> why do you quote just this sentence and not the one where I said that
> it's not clear what exactly this means?
> But to make it clear: on my system
>
> img = With[{n = 16^2},


> ArrayFlatten[
> Partition[
> Table[{x, y, z}, {z, 0, 1, 1/(n - 1)}, {y, 0, 1, 1/(n - 1)}, {x,

> 0, 1, 1/(n - 1)}], Sqrt[n]]]] // Image[#, "Real"] &;
> Export["~/tmp/24bit.bmp", img, "ColorDepth" -> 24]
>
> results in an image which really has 256^3 different colors and *no*, I
> could not see the difference between adjacent pixels since my eyes are
> too bad. But Gimp told me that every pixel is different and
>
> img2 = Import["~/tmp/24bit.bmp"];
> Union@Flatten[img2[[1]], 1] // Dimensions
>
> {16777216, 3}
>
> looks promising too.
> I hope this was what Roger wanted to know.
>
> Cheers
> Patrick


>
>
> On Wed, 2009-11-25 at 16:53 -0600, DrMajorBob wrote:
>> > every pixel has different rgb-values. This means if you put n=16^2 you

>> > would have 256x256x256 colors...
>>
>> No... it means you'd have RGBColor with 256x256x256 distinct parameter
>> triplets. That doesn't prove they're all distinct, implemented COLORS.
>>
>> We could set n=1024^2 just as easily, but is there an implemented color
>> model (in Mathematica) with the required depth?
>>
>> Bobby


--
DrMaj...@yahoo.com

DrMajorBob

unread,
Nov 25, 2009, 11:04:17 PM11/25/09
to

Patrick Scheibe

unread,
Nov 25, 2009, 11:04:39 PM11/25/09
to
Hi,

why do you quote just this sentence and not the one where I said that
it's not clear what exactly this means?
But to make it clear: on my system

img = With[{n = 16^2},

ArrayFlatten[
Partition[
Table[{x, y, z}, {z, 0, 1, 1/(n - 1)}, {y, 0, 1, 1/(n - 1)}, {x,

0, 1, 1/(n - 1)}], Sqrt[n]]]] // Image[#, "Real"] &;
Export["~/tmp/24bit.bmp", img, "ColorDepth" -> 24]

results in an image which really has 256^3 different colors and *no*, I
could not see the difference between adjacent pixels since my eyes are
too bad. But Gimp told me that every pixel is different and

img2 = Import["~/tmp/24bit.bmp"];
Union@Flatten[img2[[1]], 1] // Dimensions

{16777216, 3}

looks promising too.
I hope this was what Roger wanted to know.

Cheers
Patrick


On Wed, 2009-11-25 at 16:53 -0600, DrMajorBob wrote:

0 new messages