| Image-to-map conversion | |
|
|
Author | Message |
---|
Metalhead33 Peasant
![Peasant Peasant](https://i.imgur.com/ZL22L4O.gif)
![Metalhead33](https://2img.net/u/1112/86/44/25/avatars/390-34.png)
Messages : 4 Quality Points : 0 Registration Date : 2016-06-12 Age : 32 Location : Budapest, Hungary
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Image-to-map conversion 2016-06-12, 05:10 | |
| Hello everyone!
Currently, I am in charge of a project that would convert images to maps for H4: https://github.com/Metalhead33/Homm4-img2map
Why? Because I have an image of a map, and I am too lazy to make a map based off it by hand, so I'll convert the pixels of the image to terrain types.
Currently, my program isn't functional, and it's for Homm4, BUT... Homm3 uses the same format: map compressed into .gzip. So, if there is a demand, I can expand my project to work for both Homm3 and Homm4.
I have this image. I will clean it up, pick a specific part of it, and then I'll be able to convert it into a H4 map. | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Orzie Master Modder
![Master Modder Master Modder](https://i.imgur.com/IpF8FfL.gif)
![Orzie](https://2img.net/u/1112/86/44/25/avatars/164-43.gif)
Messages : 2166 Quality Points : 843 Registration Date : 2014-12-12 Age : 32 Location : Turkey
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-12, 05:12 | |
| Nice! Would love to see such tool working for Heroes 1-3 too. ________________________ ![Image-to-map conversion L18zg1M](https://i.imgur.com/l18zg1M.jpg) | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Metalhead33 Peasant
![Peasant Peasant](https://i.imgur.com/ZL22L4O.gif)
![Metalhead33](https://2img.net/u/1112/86/44/25/avatars/390-34.png)
Messages : 4 Quality Points : 0 Registration Date : 2016-06-12 Age : 32 Location : Budapest, Hungary
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-12, 05:14 | |
| - Orzie wrote:
- Nice! Would love to see such tool working for Heroes 1-3 too.
Once I manage to get my converter to work, I will do some research on H1-3 map formats, and get to working on it Be warned though, my tool will only generate terrain types - the map will be devoid of any objects on it. That will have to be put on it by the player. | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Orzie Master Modder
![Master Modder Master Modder](https://i.imgur.com/IpF8FfL.gif)
![Orzie](https://2img.net/u/1112/86/44/25/avatars/164-43.gif)
Messages : 2166 Quality Points : 843 Registration Date : 2014-12-12 Age : 32 Location : Turkey
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-12, 05:15 | |
| That's how it must be done. Still, the mapmaker must remember that impassable terrain squares are colored with a darker version of a terrain color on the map. ________________________ ![Image-to-map conversion L18zg1M](https://i.imgur.com/l18zg1M.jpg) | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Thorjac Gargoyle
![Gargoyle Gargoyle](https://i.imgur.com/EMdf43j.gif)
![Thorjac](https://i.imgur.com/f6yn7Vg.png)
Messages : 12 Quality Points : 5 Registration Date : 2015-09-10
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-12, 08:56 | |
| This is already possible for Heroes III through the WoG editor. | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
BoseDrache Nomad
![Nomad Nomad](https://i.imgur.com/REszosb.gif)
![BoseDrache](https://2img.net/u/1112/86/44/25/avatars/253-23.jpg)
Messages : 66 Quality Points : 50 Registration Date : 2015-08-01
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-12, 11:46 | |
| I have 144x144 image to H3 map conversion program. Have written it myself, it creates 144x144 landscape and 144x144 obstacle images, so one should draw a map manually. | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Metalhead33 Peasant
![Peasant Peasant](https://i.imgur.com/ZL22L4O.gif)
![Metalhead33](https://2img.net/u/1112/86/44/25/avatars/390-34.png)
Messages : 4 Quality Points : 0 Registration Date : 2016-06-12 Age : 32 Location : Budapest, Hungary
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-12, 22:51 | |
| - BoseDrache wrote:
- I have 144x144 image to H3 map conversion program.
Have written it myself, it creates 144x144 landscape and 144x144 obstacle images, so one should draw a map manually. Is that so? May I take a look at the source code please? *cute face* | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
BoseDrache Nomad
![Nomad Nomad](https://i.imgur.com/REszosb.gif)
![BoseDrache](https://2img.net/u/1112/86/44/25/avatars/253-23.jpg)
Messages : 66 Quality Points : 50 Registration Date : 2015-08-01
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-13, 23:20 | |
| Since that was long time ago, I don't even understand all the features I've implemented there. It was a GameMaker program... I can retell the idea. I. Rough (but correct) conversion 1. You divide your picture into 2x2 squares. 2. For every square you try all the landscape types. Then for all 4 pixels in a square you choose if it should be clear or have obstacle - minimum of these 2 values: (r-r_cl)^2+(g-g_cl)^2+(b-b_cl)^2 (r-r_ob)^2+(g-g_ob)^2+(b-b_ob)^2 3. Summarizing 4 minimal values of 4 pixels you minimize it again across the landscape types and then attach a landscape type with minimal sum to a square. Rough conversion gives you a correct, but lower than possible resolution pseudographics. II. Auxiliary conversion (incorrect in terms of Editor) 1. For every pixel (independently) you try all possible combinations of landscape types and obstacle/free settings. Attach a combination with minimal sum (as above) to a pixel. III. Through a number of iterations you remove incorrect places such as alone cells or thin (1-cell) bands from (II) using (I) as an origin. How it works. (Origin image - just a random cat from net) ![Image-to-map conversion Prog1](https://2img.net/h/s32.postimg.cc/o774kzs2d/prog1.png) (Results - landscape map, obstacles map and preview) ![Image-to-map conversion Prog2](https://2img.net/h/s32.postimg.cc/5g57atxhx/prog2.png) | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Metalhead33 Peasant
![Peasant Peasant](https://i.imgur.com/ZL22L4O.gif)
![Metalhead33](https://2img.net/u/1112/86/44/25/avatars/390-34.png)
Messages : 4 Quality Points : 0 Registration Date : 2016-06-12 Age : 32 Location : Budapest, Hungary
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-19, 09:05 | |
| Even more good news! Together with a friend of mine, we have started working on the map converter even more than before. And I have already managed to get a few maps converted.
Here is the proof: http://www.mediafire.com/download/3w722k5450u2r6c/H4converted_maps.7z | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Darmani Master Modder
![Master Modder Master Modder](https://i.imgur.com/IpF8FfL.gif)
![Darmani](https://2img.net/u/1112/86/44/25/avatars/170-23.png)
Messages : 289 Quality Points : 47 Registration Date : 2014-12-27
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-19, 14:55 | |
| Nice! Let me know if you want help on the H2 map format. ![Smile](/users/1112/86/44/25/smiles/3275789839.gif) | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Pitsu Pikeman
![Pikeman Pikeman](https://i.imgur.com/mzZ0KDq.gif)
![Pitsu](https://2img.net/u/1112/86/44/25/avatars/256-77.jpg)
Messages : 45 Quality Points : 32 Registration Date : 2015-08-02
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-19, 21:00 | |
| - BoseDrache wrote:
(r-r_cl)^2+(g-g_cl)^2+(b-b_cl)^2 (r-r_ob)^2+(g-g_ob)^2+(b-b_ob)^2
Although the conversion is not exactly to grayscale, the number of colors in H3 is limited. Thus have you also tried with the relative corrections for human eye perciption? like: 0.3*(r-r_cl)^2+ 0.59*(g-g_cl)^2+ 0.11*(b-b_cl)^2 maybe it has no effect, and if it has, then only in certain cases, but it may be something to think about when doing palette reductions | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
BoseDrache Nomad
![Nomad Nomad](https://i.imgur.com/REszosb.gif)
![BoseDrache](https://2img.net/u/1112/86/44/25/avatars/253-23.jpg)
Messages : 66 Quality Points : 50 Registration Date : 2015-08-01
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-20, 02:50 | |
| - Pitsu wrote:
- Thus have you also tried with the relative corrections for human eye perciption?
like: 0.3*(r-r_cl)^2+ 0.59*(g-g_cl)^2+0.11*(b-b_cl)^2 I've tried it today. The result is in general worse than for equal coefficients. Same cat: ![Image-to-map conversion Cat3](https://2img.net/h/s31.postimg.cc/ccths9mzv/cat3.jpg) | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Baronus Nomad
![Nomad Nomad](https://i.imgur.com/REszosb.gif)
![Baronus](https://2img.net/u/1112/86/44/25/avatars/392-12.jpg)
Messages : 64 Quality Points : 1 Registration Date : 2016-06-12
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion 2016-06-21, 09:53 | |
| I found imagemagic for HIII but it generate only landscape. If it is possible good thing will be generating full playable map. Very good idea. | |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
Sponsored content
![Image-to-map conversion Empty](https://2img.net/i/empty.gif) | Subject: Re: Image-to-map conversion ![Image-to-map conversion Icon_minitime](https://2img.net/i/fa/icon_minitime.gif) | |
| |
|
![Go down](https://i.servimg.com/u/f39/09/02/91/38/arrow-23.png) | |
| Image-to-map conversion | |
|