Hi List, I'm trying to get the average color data from an image. I'm using pix_dump and then trying to use 'average' to get the average of the dump, but the numbers are not matching. i tested just a 1 pixel image, got 4 values - 0.341176 0.360784 0.345098 1 - but the average is wrong - average: 0.35098. anybody know what i'm doing wrong or know of an easier way? I'm on windows (pd .39-2) and just using gem... BTW, does pix_resize work? thanks! here's the patch:
#N canvas 514 -19 949 762 10; #X obj 143 110 gemhead; #X obj 25 259 gemwin; #X msg 25 110 create; #X msg 53 142 1; #X msg 53 172 0; #X msg 25 208 destroy; #X obj 143 203 pix_dump; #X msg 154 167 bang; #X obj 143 387 pix_texture; #X msg 149 366 quality 0; #X obj 143 409 square 2; #X obj 149 343 loadbang; #X text 197 167 trigger the pix_dump; #X obj 194 254 print dump; #X msg 398 174 bang; #X msg 559 180 clear; #X floatatom 299 195 0 0 0 0 - - -; #X obj 143 135 pix_image dumptest3.jpg; #X obj 338 280 print average; #X text 31 40 dump the pixles of the image & get an average; #X obj 338 232 average 4; #X connect 0 0 17 0; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 8 0; #X connect 6 1 13 0; #X connect 6 1 16 0; #X connect 7 0 6 0; #X connect 8 0 10 0; #X connect 9 0 8 0; #X connect 11 0 9 0; #X connect 14 0 20 0; #X connect 15 0 20 0; #X connect 16 0 20 0; #X connect 17 0 6 0; #X connect 20 0 18 0;