Colour Depth Reduction

Aug 4, 2006 at 3:28pm

Colour Depth Reduction

Hi

Is it possible to reduce the colour depth of an image in a matrix below the apparent 24 bit minimum? The smallest data type I can use for the matrix is a char but I want to go down to say 4 or 16 colours in an image.

It may be something I’m obviously missing but I’m a newbie.

Thanks, Dave

#27038
Aug 4, 2006 at 3:53pm

use jit.charmap but with a matrix map with a lower matrix size, like
[ 4 char 4 4] and fill them. that would make 16 bit color (total,
not per channel right guys?), just try it out. Alter the charmap
helpfile.

v a d e //

http://www.vade.info
abstrakt.vade.info

On Aug 4, 2006, at 11:28 AM, Dave P wrote:

>
> Hi
>
> Is it possible to reduce the colour depth of an image in a matrix
> below the apparent 24 bit minimum? The smallest data type I can use
> for the matrix is a char but I want to go down to say 4 or 16
> colours in an image.
>
> It may be something I’m obviously missing but I’m a newbie.
>
> Thanks, Dave
> –
> MAX/MSP 4.5.7 | PLUGGO 3.5.4 | Nuendo 3 (latest) | WIN XP Home |
> Intel Celeron 2.8GHz | Sony Vaio
>

#81447
Aug 4, 2006 at 4:21pm

Thanks Vade

I’ll try that…. when I’ve cooked some dinner.

#81448
Aug 4, 2006 at 4:31pm

with a normal 4 char matrix, you can try doing a bitwise AND with jit.op. like this:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 331 147 26 196617 240;
#P message 297 147 26 196617 224;
#P message 228 147 26 196617 128;
#P message 262 147 26 196617 192;
#P number 263 182 98 9 0 0 2048 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 191 202 82 1441802 jit.op @op &;
#P connect 3 0 1 0;
#P connect 2 0 1 0;
#P connect 4 0 1 0;
#P connect 5 0 1 0;
#P connect 1 0 0 1;
#P window clipboard copycount 6;

#81449
Aug 6, 2006 at 10:39am

Thanks folks

I got both techniques working – so now I’m spoilt for choice.

Dave

#81450

You must be logged in to reply to this topic.