Forums > Jitter

Colour Depth Reduction

August 4, 2006 | 3:28 pm

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


August 4, 2006 | 3:53 pm

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
>


August 4, 2006 | 4:21 pm

Thanks Vade

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


August 4, 2006 | 4:31 pm

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;


August 6, 2006 | 10:39 am

Thanks folks

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

Dave


Viewing 5 posts - 1 through 5 (of 5 total)