code: protected BufferedImage getTileImage (BufferedImage img,
          FringeConfiguration.FringeTileSetRecord tsr, int baseset, int index, int hashValue,
          Map<Long, BufferedImage> masks)
          throws NoSuchTileSetException
      {
          int fringeset = tsr.fringe_tsid;
          TileSet fset = _tmgr.getTileSet(fringeset);
          if (!tsr.mask) {
              // oh good, this is easy
              Tile stamp = fset.getTile(index);
              return stampTileImage(stamp, img, stamp.getWidth(), stamp.getHeight());
          }
  
          // otherwise, it's a mask..
          Long maskkey = Long.valueOf((((long)baseset) << 32) + (fringeset << 16) + index);
          BufferedImage mask = masks.get(maskkey);
          if (mask == null) {
              BufferedImage fsrc = _tmgr.getTileSet(fringeset).getRawTileImage(index);
              BufferedImage bsrc = _tmgr.getTileSet(baseset).getRawTileImage(0);
              mask = ImageUtil.composeMaskedImage(_imgr, fsrc, bsrc);
              masks.put(maskkey, mask);
          }
  
          return stampTileImage(mask, img, mask.getWidth(null), mask.getHeight(null));
      }
docs: Retrieve or compose an image for the specified fringe.