Forums > Jitter

low res imagunit processing

January 21, 2007 | 6:36 pm

hi all,

playing around with jit.gl.imageunit to see if i can adapt a few things for a videosynth I have been using…

so the question is:
is there a way to send low resolution matrix data into jit.gl.imageunit without any interpolation? see the attached patch.

I am aiming for sharp low resolution images if possible. maybe I have to go in and edit or recode the imageunit files themselves?

thanks in advance,
matthew
http://www.mbiederman.com

max v2;
#N vpatcher 20 74 827 808;
#P toggle 166 176 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 185 177 29 196617 gate;
#P toggle 53 293 15 0;
#P message 70 293 52 196617 interp $1;
#P number 403 155 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 365 155 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 333 184 74 196617 pak dim 10 10;
#P button 164 200 15 0;
#P newex 124 91 27 196617 + 1;
#P user ubumenu 124 70 100 196617 0 1 1 0;
#X add pass;
#X add imageunits;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 124 253 38 196617 gate 2;
#P toggle 158 288 15 0;
#P message 175 288 49 196617 adapt $1;
#P newex 184 220 109 196617 jit.noise 4 char 10 10;
#P newex 230 286 94 196617 prepend colormode;
#P user ubumenu 233 265 100 196617 0 1 1 0;
#X add auto;
#X add luminance;
#X add intensity;
#X add depth;
#X add lumalpha;
#X add rgb;
#X add argb;
#X add uyvy;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P flonum 731 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 694 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 44 636 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 44 658 49 196617 ortho $1;
#P newex 155 516 74 196617 t getparamlist;
#P flonum 657 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 620 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 582 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 544 426 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 502 446 15 0;
#P newex 502 468 158 196617 pack param 0 0. 0. 0. 0. 0. 0.;
#P user ubumenu 523 405 166 196617 0 1 1 0;
#X add Center;
#X add Width;
#X add Sharpness;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 326 421 25 196617 iter;
#P newex 326 443 75 196617 prepend append;
#P newex 326 398 92 196617 t l clear;
#P newex 180 422 25 196617 iter;
#P newex 355 514 90 196617 prepend getparam;
#P user ubumenu 355 492 138 196617 0 1 1 0;
#X add Center;
#X add Width;
#X add Sharpness;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 246 515 92 196617 prepend loadeffect;
#P newex 180 444 75 196617 prepend append;
#P user ubumenu 180 481 142 196617 0 1 1 0;
#X add Addition;
#X add "Affine Clamp";
#X add "Affine Tile";
#X add "Affine Transform";
#X add "Blend With Mask";
#X add Bloom;
#X add "Bump Distortion";
#X add Checkerboard;
#X add "Circle Splash Distortion";
#X add "Circular Screen";
#X add "Circular Wrap Distortion";
#X add "CMYK Halftone";
#X add "Color Blend Mode";
#X add "Color Burn Blend Mode";
#X add "Color Controls";
#X add "Color Cube";
#X add "Color Dodge Blend Mode";
#X add "Color Invert";
#X add "Color Map";
#X add "Color Matrix";
#X add "Color Monochrome";
#X add "Color Posterize";
#X add "Constant Color";
#X add "Copy Machine";
#X add Crop;
#X add Crystallize;
#X add "Darken Blend Mode";
#X add "Difference Blend Mode";
#X add "Disintegrate with Mask";
#X add "Displacement Distortion";
#X add Dissolve;
#X add "Dot Screen";
#X add Edges;
#X add "Edge Work";
#X add "Exclusion Blend Mode";
#X add "Exposure Adjust";
#X add "False Color";
#X add Flash;
#X add "Gamma Adjust";
#X add "Gaussian Blur";
#X add "Gaussian Gradient";
#X add "Glass Distortion";
#X add "Glass Lozenge";
#X add Gloom;
#X add "Hard Light Blend Mode";
#X add "Hatched Screen";
#X add "Height Field From Mask";
#X add "Hole Distortion";
#X add "Hue Adjust";
#X add "Hue Blend Mode";
#X add Kaleidoscope;
#X add "Lanczos Scale Transform";
#X add "Lenticular Halo";
#X add "Lighten Blend Mode";
#X add "Linear Gradient";
#X add "Line Screen";
#X add "Luminosity Blend Mode";
#X add "Mask To Alpha";
#X add Maximum;
#X add Median;
#X add Minimum;
#X add Mod;
#X add "Motion Blur";
#X add "Multiply Blend Mode";
#X add Multiply;
#X add "Noise Reduction";
#X add "Op Tile";
#X add "Overlay Blend Mode";
#X add "Page Curl";
#X add "Parallelogram Tile";
#X add "Perspective Tile";
#X add "Perspective Transform";
#X add "Pinch Distortion";
#X add Pixellate;
#X add Pointillize;
#X add "Radial Gradient";
#X add "Random Generator";
#X add Ripple;
#X add "Saturation Blend Mode";
#X add "Screen Blend Mode";
#X add "Sepia Tone";
#X add "Shaded Material";
#X add "Sharpen Luminance";
#X add "Soft Light Blend Mode";
#X add "Source Atop";
#X add "Source In";
#X add "Source Out";
#X add "Source Over";
#X add "Spot Light";
#X add "Star Shine";
#X add Stripes;
#X add Sunbeams;
#X add Swipe;
#X add "Torus Lens Distortion";
#X add "Triangle Tile";
#X add "Twirl Distortion";
#X add "Unsharp Mask";
#X add "Vortex Distortion";
#X add "White Point Adjust";
#X add "Zoom Blur";
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 180 399 92 196617 t l clear;
#P newex 180 376 303 196617 route effectlist paramlist;
#P newex 438 403 31 196617 print;
#P message 155 551 33 196617 reset;
#P newex 155 572 79 196617 jit.gl.handle foo;
#P newex 137 602 187 196617 jit.gl.videoplane foo @scale 1.333 1. 1.;
#P newex 137 331 198 196617 jit.gl.imageunit foo @verbose 1 @inputs 1;
#P toggle 321 644 15 0;
#P message 321 662 45 196617 sync $1;
#P toggle 248 644 15 0;
#P newex 209 643 35 196617 sel 27;
#P message 248 662 68 196617 fullscreen $1;
#P newex 166 686 145 196617 jit.window foo @size 640 480;
#P newex 164 643 40 196617 key;
#P user jit.fpsgui 49 250 60 196617 0;
#P toggle 27 102 15 0;
#P newex 27 128 55 196617 qmetro 33;
#P newex 27 156 55 196617 t b b erase;
#P newex 27 685 125 196617 jit.gl.render foo @ortho 2;
#P toggle 242 551 15 0;
#P message 242 572 82 196617 blend_enable $1;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P connect 54 0 2 0;
#P connect 3 0 2 0;
#P fasten 3 2 2 0 76 232 32 232;
#P connect 38 0 2 0;
#P connect 39 0 38 0;
#P connect 3 1 6 0;
#P connect 55 0 54 0;
#P connect 48 0 49 0;
#P connect 49 0 47 0;
#P fasten 51 0 14 0 338 326 142 326;
#P fasten 25 0 14 0 360 537 125 537 125 322 142 322;
#P fasten 37 0 14 0 160 537 125 537 125 322 142 322;
#P fasten 23 0 14 0 251 537 125 537 125 322 142 322;
#P fasten 31 0 14 0 507 537 125 537 125 322 142 322;
#P fasten 43 0 14 0 235 326 142 326;
#P connect 45 0 14 0;
#P fasten 47 1 14 0 157 270 142 270;
#P connect 14 0 15 0;
#P connect 54 0 15 0;
#P connect 47 0 15 0;
#P fasten 16 0 15 0 160 595 142 595;
#P fasten 0 0 15 0 247 595 142 595;
#P fasten 44 0 47 1 189 239 157 239;
#P connect 17 0 16 0;
#P connect 54 0 8 0;
#P fasten 9 0 8 0 253 681 171 681;
#P fasten 12 0 8 0 326 681 171 681;
#P connect 46 0 45 0;
#P fasten 14 1 19 0 330 358 185 358;
#P connect 19 0 20 0;
#P connect 20 0 26 0;
#P connect 26 0 22 0;
#P fasten 20 1 21 0 267 467 185 467;
#P connect 22 0 21 0;
#P connect 51 0 44 0;
#P connect 56 0 44 0;
#P connect 50 0 44 0;
#P connect 57 0 56 0;
#P connect 3 1 56 1;
#P fasten 7 0 10 0 169 662 206 662 206 641 214 641;
#P connect 42 1 43 0;
#P connect 1 0 0 0;
#P fasten 21 1 23 0 251 511 251 511;
#P fasten 10 0 11 0 214 661 245 661 245 641 253 641;
#P connect 11 0 9 0;
#P connect 13 0 12 0;
#P connect 19 1 27 0;
#P connect 27 0 29 0;
#P connect 29 0 28 0;
#P fasten 27 1 24 0 413 466 360 466;
#P fasten 28 0 24 0 331 481 360 481;
#P connect 24 0 25 0;
#P connect 52 0 51 1;
#P fasten 53 0 51 2 408 177 402 177;
#P fasten 19 2 18 0 477 398 443 398;
#P fasten 36 0 32 0 662 443 507 443;
#P fasten 34 0 32 0 587 443 507 443;
#P fasten 33 0 32 0 549 443 507 443;
#P fasten 35 0 32 0 625 443 507 443;
#P fasten 40 0 32 0 699 443 507 443;
#P fasten 41 0 32 0 736 443 507 443;
#P connect 32 0 31 0;
#P fasten 27 1 30 0 413 440 497 440 497 390 528 390;
#P fasten 28 0 30 0 331 472 497 472 497 390 528 390;
#P connect 30 0 31 1;
#P fasten 33 0 31 2 549 454 549 454;
#P fasten 34 0 31 3 587 454 570 454;
#P fasten 35 0 31 4 625 456 591 456;
#P fasten 36 0 31 5 662 459 612 459;
#P fasten 40 0 31 6 699 462 633 462;
#P fasten 41 0 31 7 736 465 654 465;
#P pop;


January 21, 2007 | 8:24 pm

On Jan 21, 2007, at 10:36 AM, mbiederman wrote:

> so the question is:
> is there a way to send low resolution matrix data into
> jit.gl.imageunit without any interpolation? see the attached patch.
> I am aiming for sharp low resolution images if possible. maybe I
> have to go in and edit or recode the imageunit files themselves?

The issue is that the default internal texture for jit.gl.imageunit
is the only one that the interp message affects (which is only used
if the input is a jit.matrix rather than a jit.gl.texture object).
The output texture of jit.gl.imageunit accepts all the messages as
jit.gl.texture via the sendoutput message. So you can achieve the
results you want with "sendoutput filter nearest" to
jit.gl.imageunit, or send through an instance of jit.gl.texture
@filter nearest, in order achieve nearest neighbor sampling.

-Joshua


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