So you would like to generate these blocks (256 of them) from the largest image and then use them to build other images.
Besides looking for answers in this forum, I suggest you visit forums.wesnoth.org. I used to follow their development, esp. the art side, because it was so interesting. There have been discussions about sprite sheets but I don’t know whether they are relevant to you.