How do I layer multiple images in a Max MSP patch

technicolorenvy's icon

I have a photo and patch attached to explain the concept, but essentially, I want to have a background video or image with multiple pngs layered on top.

how would I achieve this? I sense that jit.alphablend is a component of this...

{
    "patcher" :     {
        "fileversion" : 1,
        "appversion" :         {
            "major" : 6,
            "minor" : 0,
            "revision" : 4
        }
,
        "rect" : [ 190.0, 131.0, 807.0, 516.0 ],
        "bglocked" : 0,
        "openinpresentation" : 0,
        "default_fontsize" : 12.0,
        "default_fontface" : 0,
        "default_fontname" : "Arial",
        "gridonopen" : 0,
        "gridsize" : [ 15.0, 15.0 ],
        "gridsnaponopen" : 0,
        "statusbarvisible" : 2,
        "toolbarvisible" : 1,
        "boxanimatetime" : 200,
        "imprint" : 0,
        "enablehscroll" : 1,
        "enablevscroll" : 1,
        "devicewidth" : 0.0,
        "description" : "",
        "digest" : "",
        "tags" : "",
        "boxes" : [             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-4",
                    "linecount" : 3,
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 19.0, 44.0, 155.0, 48.0 ],
                    "text" : "foreground image herenwould like to have multiple pngs here"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-1",
                    "linecount" : 2,
                    "maxclass" : "comment",
                    "numinlets" : 1,
                    "numoutlets" : 0,
                    "patching_rect" : [ 512.0, 44.0, 150.0, 34.0 ],
                    "text" : "Background image or movie here"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-38",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 675.0, 96.0, 91.0, 18.0 ],
                    "text" : "frame $1, bang"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-37",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 675.0, 67.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-34",
                    "maxclass" : "number",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "int", "bang" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 691.0, 274.0, 50.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-33",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 635.0, 96.0, 34.0, 18.0 ],
                    "text" : "start"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-32",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 598.0, 96.0, 33.0, 18.0 ],
                    "text" : "stop"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-28",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 2,
                    "outlettype" : [ "", "" ],
                    "patching_rect" : [ 691.0, 221.0, 85.0, 20.0 ],
                    "text" : "route duration"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-20",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "jit_matrix", "" ],
                    "patching_rect" : [ 200.395844, 115.0, 123.0, 20.0 ],
                    "text" : "jit.qt.movie @adapt 1"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-21",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 200.395844, 44.0, 35.0, 18.0 ],
                    "text" : "read"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-14",
                    "maxclass" : "jit.pwindow",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "", "" ],
                    "patching_rect" : [ 574.604126, 228.0, 73.791687, 54.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-11",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 2,
                    "outlettype" : [ "jit_matrix", "" ],
                    "patching_rect" : [ 271.0, 262.0, 81.0, 20.0 ],
                    "text" : "jit.alphablend"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-10",
                    "maxclass" : "button",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 540.0, 115.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-8",
                    "maxclass" : "jit.pwindow",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "", "" ],
                    "patching_rect" : [ 33.0, 328.0, 234.791672, 161.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-7",
                    "maxclass" : "newobj",
                    "numinlets" : 1,
                    "numoutlets" : 2,
                    "outlettype" : [ "jit_matrix", "" ],
                    "patching_rect" : [ 594.0, 150.0, 116.0, 20.0 ],
                    "text" : "jit.qt.movie @loop 0"
                }

            }
,             {
                "box" :                 {
                    "id" : "obj-5",
                    "maxclass" : "toggle",
                    "numinlets" : 1,
                    "numoutlets" : 1,
                    "outlettype" : [ "int" ],
                    "parameter_enable" : 0,
                    "patching_rect" : [ 354.0, 30.0, 20.0, 20.0 ]
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-3",
                    "maxclass" : "newobj",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "bang" ],
                    "patching_rect" : [ 354.0, 67.0, 58.0, 20.0 ],
                    "text" : "metro 40"
                }

            }
,             {
                "box" :                 {
                    "fontname" : "Arial",
                    "fontsize" : 12.0,
                    "id" : "obj-2",
                    "maxclass" : "message",
                    "numinlets" : 2,
                    "numoutlets" : 1,
                    "outlettype" : [ "" ],
                    "patching_rect" : [ 560.0, 96.0, 35.0, 18.0 ],
                    "text" : "read"
                }

            }
 ],
        "lines" : [             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-10", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-8", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "midpoints" : [ 280.5, 313.5, 42.5, 313.5 ],
                    "source" : [ "obj-11", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-2", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-11", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-20", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-20", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-21", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-34", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-28", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-10", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-3", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-20", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-3", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-32", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-33", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-38", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-37", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-7", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-38", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-3", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-5", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-11", 1 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "midpoints" : [ 603.5, 224.5, 342.5, 224.5 ],
                    "source" : [ "obj-7", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-14", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-7", 0 ]
                }

            }
,             {
                "patchline" :                 {
                    "destination" : [ "obj-28", 0 ],
                    "disabled" : 0,
                    "hidden" : 0,
                    "source" : [ "obj-7", 1 ]
                }

            }
 ],
        "dependency_cache" : [  ]
    }

}

3816.layerexample.png
png
technicolorenvy's icon

sorry, not sure how to add code in a user friendly way, including a file for ease...

3817.helpmaxmsptest.txt
txt
Luke Woodbury's icon
technicolorenvy's icon

sweet, that is a huge help, Thankyou!

Peter Ostry's icon

technicolorenvy wrote:
sorry, not sure how to add code in a user friendly way ...

In Max select all parts and choose "Copy compressed" from the Edit menu. If you paste that here, it gets finally displayed as one line.

illachime's icon
Luke Woodbury's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I can't read it either, but it probably had something like this:

Luke Woodbury's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Doh, forgot about layers, try this: