link graphics

procedure main()
   local prohibit, unicorn, width, height, white, mask, palette

   prohibit :=
      $include "prohibit.ims"

   unicorn :=
      $include "unicorn.ims"

   prohibit ?:= {
      width := tab(upto(','))
      move(1)
      palette := tab(upto(','))
      move(1)
      white := PaletteKey(palette, "white")
      width || "," || palette || "," || map(tab(0), white, "~") 
      }

   unicorn ? {
      width := tab(upto(','))		# use this width for window
      move(1)
      tab(upto(',') + 1)		# skip palette
      height := *tab(0) / width
      }

   WOpen("size=" || width || "," || height) |
      stop("*** cannot open window")

   DrawImage(0, 0, unicorn)

   DrawImage(0, 0, prohibit)

   WDone()

end