selliott4 Posted May 13, 2017 I recently created an open source command line utility named "wad2image" that converts maps in WAD files to images. There are many options to control how the images are created. wad2image can select multiple maps from multiple WAD files and create images for those maps. wad2image can create animated GIFs to illustrate the differences between revisions of a map. I made a web page for it as well as a github page. I hope it's helpful. Feedback would be great. 6 Quote Share this post Link to post
snapshot Posted May 13, 2017 Interesting, does this work just for layouts ? 0 Quote Share this post Link to post
selliott4 Posted May 13, 2017 I think so if by layout you mean two 2D floor plans. It does not create anything like 3D images from inside the map. 0 Quote Share this post Link to post
Bauul Posted May 13, 2017 Very nice little tool! I wonder though, with a UI built on top of the command lines, this could make an awesome little addition to GZDoomBuilder_BugFix if you were happy to have it included. @ZZYZX Just tagging you to show you this. If anyone has ever asked about GZDB having an "Export to image" function, this could be quite cool. 0 Quote Share this post Link to post
selliott4 Posted May 13, 2017 I'm happy to have wad2image bundled, but it's GPLv2+. I gave it that license because it includes some Yadex files, which is GPLv2+. I'm not sure what GZDB's license is. Even if wad2image was not bundled installing it is pretty easy. And running it from another program shouldn't be hard. 0 Quote Share this post Link to post
torekk Posted May 13, 2017 (edited) Thanks, will come in handy at some point. Edited May 13, 2017 by torekk 0 Quote Share this post Link to post
torekk Posted June 2, 2017 It seems even if I specify the doom2 IWAD, any doom2 sprites won't be rendered? Atleast a hell knight turns up as a red dot, instead of the actual sprite. I also can't get animate to work on my Raspberry Pi 3, I get this error each time: pi@raspberrypi:~/doom/wad2image/bin $ python wad2image.py -c yadex --iwad ../../doom2.wad -d gif-keep -s --show-cmd animate ../../Feveswar.wad ../../Feveswar2.wad Show command "animate" failed with an exception: [Errno 2] No such file or directory 0 Quote Share this post Link to post
selliott4 Posted June 7, 2017 On 6/2/2017 at 9:30 AM, torekk said: It seems even if I specify the doom2 IWAD, any doom2 sprites won't be rendered? Atleast a hell knight turns up as a red dot, instead of the actual sprite. Sorry for the late response. I haven't logged in recently. I see what you mean about the Hell Knight. I just reproduced the red dot problem with Doom2's MAP06. Other Doom 2 monsters are rendered, but not the Hell Knight. wad2image is confused by the sprite name. The sprite prefix is "BOS2" so wad2image expects the sprite frame to be "BOS2A1" or "BOS2A1D1", but actually it's "BOS2A1C1". I don't quite understand how the sprite names work, but I'll see if I can get it working this weekend if not sooner. The error you got about wad2image not being able to find "animate" is because of "-s --show-cmd animate". "-s" tells wad2image to run an external command to show the images once it's done. "--show-cmd animate" changes the command from its default value of "display" to "animate", which supports GIF animation. Both "display" and "animate" are in the ImageMagick package. The good news is this is optional. wad2image probably created the images in the "images" directory, it just wasn't able to display them. Also, passing in "-v" (verbose) is handy - it gives you more information, such as the path to each image created. 0 Quote Share this post Link to post
torekk Posted June 7, 2017 (edited) Whoops, turned out I didn't have ImageMagick installed. Might help to include that on your project site under requirements. Now the animate command also works, atleast I get an popup window which flashes between both map images, it's way too fast though. The animate cmd also seems to rely on the .png files of the map, atleast when I run that with "gif" instead of "gif-keep" I get this output: Spoiler pi@raspberrypi:~/doom/wad2image/bin $ python wad2image.py -v -c yadex --iwad ../../doom2.wad -d gif -s --show-cmd animate ../../Feveswar.wad ../../Feveswar2.wad Configuration path is "../conf/yadex.conf". Yadex path is "../yadex/doom2.ygd". Loaded IWAD at "../../doom2.wad". Loaded WAD at "../../Feveswar.wad". Drew map MAP01 to "../images/map01.png". Loaded WAD at "../../Feveswar2.wad". Renamed map MAP01 image "../images/map01.png" to "../images/map01-1.png". Drew map MAP01 to "../images/map01-2.png". Created GIF MAP01 at "../images/map01.gif". Due to GIF MAP01 at "../images/map01.gif" removed "../images/map01-1.png". Due to GIF MAP01 at "../images/map01.gif" removed "../images/map01-2.png". animate: unable to open image `../images/map01-1.png': No such file or directory @ error/blob.c/OpenBlob/2712. animate: unable to open file `../images/map01-1.png' @ error/png.c/ReadPNGImage/3919. animate: unable to open image `../images/map01-2.png': No such file or directory @ error/blob.c/OpenBlob/2712. animate: unable to open file `../images/map01-2.png' @ error/png.c/ReadPNGImage/3919. Show command "animate" failed with exit status 1 However if I view the .gif file, it isn't animated, no matter which image viewer I choose(chromium, gimp, imagemagick viewer or gpicview). It also doesn't matter if I use gif-keep or not, same with the -s option, no difference with or without it. Not sure if it's just on my end or if somehow the gif creation process is flawed. Edited June 7, 2017 by torekk 0 Quote Share this post Link to post
selliott4 Posted June 8, 2017 Thanks for the feedback. I've added a sentence about ImageMagick to the requirements in wad2image's home page. You can control the animation speed with "--gif-duration". By default it's 500 milliseconds per frame. Try adding "--gif-duration 2000" to make it four times as slow with 2 seconds per frame. I've fixed the two bugs that you've found and I've released version 0.9.1. The direct download link is here. It should now render Hell Knights. Also it should also no longer have "animate: unable to open" error messages combined with a non-zero exit status. It does build the GIF files by loading the PNG files created where each PNG file is one animation frame. Generally "-d gif" is good if you don't care about keeping the static PNG images that went into building the GIF. The GIFs are valid in my testing. They appear animated in chromium, animate and gpicview. If you like I can try your "Feveswar*.wad" files. 0 Quote Share this post Link to post
selliott4 Posted June 8, 2017 I've looked at it more carefully and 0.9.1, which I mentioned in my previous comment, should fix the two bugs, but it's not as robust as I'd like it to be. It may fail if the IWAD is missing sprites. I just posted 0.9.2. The direct download link is here. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.