/* * Demonstration of use of text as a mask shape. */ size(408, 300); background(0); PImage slu = loadImage("http://business.slu.edu/uploads/2012/11/08/slu-homepage-campus4.jpg"); int w = slu.width; int h = slu.height; int fs = 275; // font size PFont f; f = createFont("AbadiMT-CondensedExtraBold", fs); PGraphics mask = createGraphics(w, h); mask.noSmooth(); mask.beginDraw(); mask.background(70); // use shade of gray for background to allow some transparency mask.fill(255); mask.textFont(f); mask.textSize(fs); mask.textAlign(CENTER, CENTER); mask.text("SLU", 0.5*w, 0.4*h); mask.endDraw(); slu.mask(mask); background(0, 64, 159); image(slu, 0, 0);