mxgmn / WaveFunctionCollapse

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics
Other
23.05k stars 1.23k forks source link

How to generate an XML data file for simpletiled from an image file? #73

Closed zydjohnHotmail closed 2 years ago

zydjohnHotmail commented 2 years ago

Hello: I saw this repo, it looks great. However, when I tried to use the repo to generate some images, I have some issues. I have a simple Captcha image: ABCYQ.PNG. I want to use it for overlapping, so I put this line in Samples.xml: `

But for my PC with 16-core CPU, I didn’t get any results after more than one hour. Then, I would like to try with simpletiled, so in the Samples.xml, I added this line:

` But I got run time error: There is no corresponding data XML file for the image. I looked at the data XML file for circle image, and I found the circle has been split into 8 parts, the data XML list all each part, and all its neighbor’s part, and subsets parts. I want to know if there is any helper program, which I can use to split the image like the circle image, and generate all parts like in circle data XML file. In the above case, I want to get a data XML file which contains 5 distinct parts: as: ‘A’, ‘B’, ‘C’, ‘Y’, ‘Q’. As ‘A’ being the left most one, ‘B’ being second part, which ‘A’ is on the left, ‘C’ on the right, etc… For more general item, can I get a split program, which can divided any image into 4 equal size parts, as left upper, right upper, left bottom, right bottom. This way, it will be much easier to run the program, otherwise, for every image, have to create a data XML file by hand, then using simpletiled seems to be impossible, using overlapping is too much time consuming. Please advise, Thanks ABCYQ ,

mxgmn commented 2 years ago

Hi! This sample image has a lot of colors / color gradients - the algorithm isn't good with such samples. Notice how all of my samples have just a few discrete colors.