public ImgTemplate(String fileName, int w, int h)
	{
		try
		{
			File file = new File(Data.getDataDirectory() + "/data/gfx/obj/" + fileName);
			BufferedImage tmpImg = ImageIO.read(file);
			this.image = new BufferedImage(tmpImg.getWidth(), tmpImg.getHeight(), BufferedImage.TYPE_INT_ARGB);
			this.image.getGraphics().drawImage(tmpImg, 0, 0, null);

			// apply transparency
			WritableRaster raster = this.image.getRaster();
			for (int j = 0; j < this.image.getHeight(); j++)
			{
				for (int i = 0; i < this.image.getWidth(); i++)
				{
					int [] pixels = raster.getPixel(i, j, (int[]) null);

					if (pixels[0] == 255 && pixels[1] == 0 && pixels[2] == 255) // magenta
					{
						pixels[3] = 0;
						raster.setPixel(i, j, pixels);
					}
				}
			}

			this.tileW = w;
			this.tileH = h;
		}
		catch(IOException ioe)
		{
			System.out.printf("Failed to load file: %s\n", fileName);
		}
	}