// Sample program to load an image, write semi-transparent "watermark" text // across it (with a semi-transparent rectangle behind it), and write it // back out to a file. g = new graphics img = new image["https://frinklang.org/images/earthmoon.jpg"] // Draw the image onto a graphics object at its original size. g.draw[img, 0, 0, img.getWidth[], img.getHeight[]] // Draw a watermark right in the center of the picture. // First a semi-transparent white rectangle g.color[1,1,1,.3] g.fillRectCenter[img.getWidth[]/2, img.getHeight[]/2, img.getWidth[], 20] // And then semi-transparent black text. g.color[0,0,0,.5] g.font["SansSerif", 20] g.text["Frink Rules!", img.getWidth[]/2, img.getHeight[]/2, "center", "center"] g.show[] //g.print[] // Write out to a file at the same size as the original. g.write["earthmoon1.jpg", img.getWidth[], img.getHeight[], 1]