Forums > Jitter

char 256 grayscale to 2 bits (4 grayscale)

May 28, 2007 | 5:39 pm

dear list

i think this is an easy question,
i have a char (256) grayscale image and i want to scale it to a 2 bit (4 posibilities) image but still using char 256, like scaling this to 4 bit and then to 8 bits, but i’m prety sure that there is something better or a better way to do it.

?

Thnks


May 29, 2007 | 4:03 am

the following patch comes close to what you’re talking about.
however you probably want to use jit.charmap. (also look at jit.map and jit.scalebias)

-rob

#P user jit.cellblock 367 263 687 503 3 9 320 240 45 17 0 1 1 0 0 0 1 1 1 0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P window setfont "Sans Serif" 9.;
#P flonum 171 154 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 171 176 42 196617 max $1;
#P flonum 123 154 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 123 176 39 196617 min $1;
#P newex 123 200 152 196617 jit.clip @min 0.49 @max 0.51;
#B color 5;
#P newex 123 222 68 196617 jit.normalize;
#B color 5;
#P user jit.pwindow 38 262 322 242 0 1 0 0 1 0;
#P toggle 27 48 15 0;
#P newex 44 46 52 196617 metro 30;
#P message 54 67 33 196617 start;
#P message 54 85 83 196617 read dishes.mov;
#P newex 44 134 66 196617 jit.rgb2luma;
#P newex 44 105 105 196617 jit.qt.movie 320 240;
#P fasten 7 0 6 0 128 248 44 248;
#P fasten 7 0 13 0 128 248 372 248;
#P connect 2 0 0 0;
#P connect 3 0 0 0;
#P connect 4 0 0 0;
#P connect 5 0 4 0;
#P connect 12 0 11 0;
#P connect 10 0 9 0;
#P connect 8 0 7 0;
#P connect 9 0 8 0;
#P connect 11 0 8 0;
#P connect 0 0 1 0;
#P fasten 1 0 8 0 49 196 128 196;
#P window clipboard copycount 14;


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