Have you seen AutoTileGen? It’s a useful-looking tool that will let its users generate tilesets from just a few images. It’s not coming out until April. Note that that is in time for LD29. It’s got an IndieGoGo campaign going, you can contribute to that here and, as perks, get a license when it comes out for $25-50 or early access for $120.
If you can’t wait or you can’t afford it for $25, though, I’ve written an alternative tool in Java, called GoTile. It’s free and it’s got a GPL version 3 license – its source code is here. I made the great majority of it in just 2 days. I think it works pretty well, but expect AutoTileGen to have less bugs, more features, and a better interface. You should be able to figure most of it out by messing with it, but custom levels should be CSVs and masks should be solid white in the shape of a tile. Here’s a screenshot, the GUI shows most of the features.
EDIT: There have been a few updates to the program since I made this post, so I updated the screenshot. Make sure to get the new version, too – I added some good stuff.