aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Henry <nusmuk@users.sourceforge.net>2014-05-09 13:58:30 +0000
committerCyrille Henry <nusmuk@users.sourceforge.net>2014-05-09 13:58:30 +0000
commit9e02be4dd6daf1ca2ddbb559f3e30917e26dd89f (patch)
treebb47e015d99522763557372c656f2301c9e10402
parent08390561e2e0f2f2f3150d4654941dba55261dd1 (diff)
add patch that convert any image file to a patch using small canvas as pixels
svn path=/trunk/externals/nusmuk/; revision=17303
-rw-r--r--nusmuk-utils/img2cnv.pd168
1 files changed, 168 insertions, 0 deletions
diff --git a/nusmuk-utils/img2cnv.pd b/nusmuk-utils/img2cnv.pd
new file mode 100644
index 0000000..9ad1667
--- /dev/null
+++ b/nusmuk-utils/img2cnv.pd
@@ -0,0 +1,168 @@
+#N canvas 130 268 898 691 10;
+#X obj 136 77 gemhead;
+#X obj 136 191 pix_image;
+#X obj 121 457 pix_data;
+#X obj 161 123 openpanel;
+#X obj 161 104 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X msg 161 144 open \$1;
+#X obj 136 217 pix_info --------;
+#X obj 63 234 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#N canvas 50 97 450 300 until 0;
+#X obj 54 82 f;
+#X obj 54 104 until;
+#X obj 54 125 f;
+#X obj 81 166 + 1;
+#X obj 54 146 t f f;
+#X obj 54 24 inlet;
+#X obj 97 24 inlet;
+#X obj 54 206 outlet;
+#X obj 54 52 t b b;
+#X msg 99 79 0;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 2 1;
+#X connect 4 0 7 0;
+#X connect 4 1 3 0;
+#X connect 5 0 8 0;
+#X connect 6 0 0 1;
+#X connect 8 0 0 0;
+#X connect 8 1 9 0;
+#X connect 9 0 2 1;
+#X restore 63 255 pd until;
+#N canvas 50 87 450 300 until 0;
+#X obj 54 24 inlet;
+#X obj 97 24 inlet;
+#X obj 54 186 outlet;
+#X obj 54 82 f;
+#X obj 54 104 until;
+#X obj 54 125 f;
+#X obj 81 166 + 1;
+#X obj 54 146 t f f;
+#X obj 54 52 t b b;
+#X msg 99 79 0;
+#X connect 0 0 8 0;
+#X connect 1 0 3 1;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 5 0 7 0;
+#X connect 6 0 5 1;
+#X connect 7 0 2 0;
+#X connect 7 1 6 0;
+#X connect 8 0 3 0;
+#X connect 8 1 9 0;
+#X connect 9 0 5 1;
+#X restore 63 301 pd until;
+#X obj 63 278 t b f;
+#X obj 151 354 /;
+#X obj 166 332 - 1;
+#X obj 63 322 t b f;
+#X obj 166 392 /;
+#X obj 181 370 - 1;
+#N canvas 1176 245 460 479 image 0;
+#X restore 441 220 pd image;
+#X obj 218 604 s pd-image;
+#N canvas 50 257 298 368 rgb2canvas_color 0;
+#X obj 49 24 inlet;
+#X obj 49 53 unpack f f f;
+#X obj 83 181 +;
+#X obj 49 205 +;
+#X obj 49 277 outlet;
+#X obj 49 254 - 1;
+#X obj 49 128 * 4096;
+#X obj 83 154 * 64;
+#X obj 49 229 * -1;
+#X obj 49 103 i;
+#X obj 83 104 i;
+#X obj 118 105 i;
+#X obj 118 80 * 63;
+#X obj 83 79 * 63;
+#X obj 49 78 * 63;
+#X connect 0 0 1 0;
+#X connect 1 0 14 0;
+#X connect 1 1 13 0;
+#X connect 1 2 12 0;
+#X connect 2 0 3 1;
+#X connect 3 0 8 0;
+#X connect 5 0 4 0;
+#X connect 6 0 3 0;
+#X connect 7 0 2 0;
+#X connect 8 0 5 0;
+#X connect 9 0 6 0;
+#X connect 10 0 7 0;
+#X connect 11 0 2 1;
+#X connect 12 0 11 0;
+#X connect 13 0 10 0;
+#X connect 14 0 9 0;
+#X restore 143 489 pd rgb2canvas_color;
+#X obj 218 536 pack f f f;
+#X msg 317 381 create \, 1;
+#X obj 300 411 gemwin;
+#X obj 276 475 * 2;
+#X obj 276 498 + 10;
+#X obj 316 475 * 2;
+#X obj 316 498 + 10;
+#X obj 166 437 -;
+#X msg 166 414 1 \$1;
+#X obj 143 511 route -262144;
+#X obj 278 88 t b b b;
+#X obj 278 63 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
+-1;
+#X obj 300 308 delay 50;
+#X msg 300 354 destroy;
+#X obj 300 331 delay 50;
+#X msg 218 559 obj \$2 \$3 cnv 0 0 0 empty empty empty 20 12 0 14 \$1
+-66577;
+#X obj 300 285 t b;
+#X msg 233 584 vis 1 \, selectall \, cut \, vis 0;
+#X text 338 64 <- select image;
+#X text 501 220 <- image will be converted to a patch in this subpatch
+using 2x2 canvas for all non white pixel of the original image;
+#X connect 0 0 1 0;
+#X connect 1 0 6 0;
+#X connect 2 1 18 0;
+#X connect 3 0 5 0;
+#X connect 3 0 35 0;
+#X connect 4 0 3 0;
+#X connect 5 0 1 0;
+#X connect 6 0 2 1;
+#X connect 6 1 12 0;
+#X connect 6 1 8 1;
+#X connect 6 2 15 0;
+#X connect 6 2 9 1;
+#X connect 7 0 8 0;
+#X connect 8 0 10 0;
+#X connect 9 0 13 0;
+#X connect 10 0 9 0;
+#X connect 10 1 11 0;
+#X connect 10 1 22 0;
+#X connect 11 0 2 2;
+#X connect 12 0 11 1;
+#X connect 13 0 2 0;
+#X connect 13 1 14 0;
+#X connect 13 1 24 0;
+#X connect 14 0 27 0;
+#X connect 15 0 14 1;
+#X connect 18 0 28 0;
+#X connect 19 0 34 0;
+#X connect 20 0 21 0;
+#X connect 22 0 23 0;
+#X connect 23 0 19 1;
+#X connect 24 0 25 0;
+#X connect 25 0 19 2;
+#X connect 26 0 2 3;
+#X connect 27 0 26 0;
+#X connect 28 1 19 0;
+#X connect 29 1 3 0;
+#X connect 29 2 36 0;
+#X connect 29 2 20 0;
+#X connect 30 0 29 0;
+#X connect 31 0 33 0;
+#X connect 31 0 8 0;
+#X connect 32 0 21 0;
+#X connect 33 0 32 0;
+#X connect 34 0 17 0;
+#X connect 35 0 31 0;
+#X connect 36 0 17 0;