I~~'m currently~~ was working on a texture pack for [minecraft](http://www.minecraft.net) (but this question is not restricted to that). All terrain textures are squared and stored in one big terrain.png. (FYI that's from [Glimmar's Steampunk pack](http://www.minecraftforum.net/viewtopic.php?t=48884)). I'd like to store each texture in an individual file and have same automated process pack them into the terrain.png later on (maybe leaving the not yet created ones their default). At the moment I do this manually by copy/pasting them with gimp (at least the raster helps a lot here) but I'd really like to do this automatically. Basically this seems to be what happens behind the scenes of the [Painterly pack customizer](http://painterlypack.net/customizer.php) already. So,

> 
> Is there a tool that replaces some ~~squares~~polygons\* in a png file with new ones (also png), the position of which might be configured in a separate file?
> 
> 
> 

**edit** Some automated resizing for different resolution versions might be nice as well...

**edit2** Meanwhile I learned that "position [...] configured in a separate file" means atlas, and since the question originated from Minecraft texture packs (IIRC the format got changed meanwhile), the ideal tool would allow for using an existing atlas to replace some of the tiles

---

\*) might as well ask the general case