Splitting maps using bitmaps

Discussion in 'General Modification' started by marc1967, May 27, 2014.

Remove all ads!
  1. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    I noticed that splitting my original maps resulted in some weird fuzziness degradation from the single map to the split images. After reading a thread from about a year ago, I see that the jpg splitter in the World Builder has a little conversion weirdness to it, so I tried using the bitmap version of the splitter, but am running into some problems maybe someone can help me with.

    I tested it with a simple recombine and split of different maps from the original game (so my own maps are not the concern here), I used a variety of five different sized maps, and they all resulted in the same problem.

    1) Recombine: The "JPG --> BMP" recombine works just fine, and a large BMP file is created, along with the TXT file which is exactly the same as would be created when recombining into a JPG. So that step is good.

    2) Splitting: The splitting however gets strange. The appropriate number of files ARE created just fine, and so are the names of the files. However, the appearance of the split BMP files is highly irregular. I've included a picture from the Moathouse Dungeon which is better that me trying to explain it words. Simply put, they seem to be split inconsistently.

    BadSplitting.jpg

    If anyone has run into this problem, or could help, I'd appreciate it, thanks.
     
  2. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    That's a known issue that seemed to pop up with the most recent WB-integrated version of the bitmap splitter. The current work-around is to use the attached standalone java app. Double click to open the app, the rest is pretty intuitive. It works well. :)
     

    Attached Files:

  3. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    Well now, that's what I call an impressive response. It works like a charm. Thanks again for the usual help.
     
  4. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    Hey Gaear, I wanted to let you know this little tool has been working great on all my new maps since you sent it too me. They're all nice and clean without all the smudgy stuff from splitting JPG's. However, there's a small problem I've been putting off asking you since I first got it, hoping that another solution would present itself, but it never has.

    The tool won't split larger maps such as Hommlet, Nulb, Emridy Meadows, the Temple dungeon levels, etc. It stops when it tries to read the bitmap file. Here's the output from log.txt.

    Code:
    May 15, 2015 1:28:34 AM toeesplitter.SplitLogger startLogging
    INFO: Initialized logging.
    May 15, 2015 1:28:53 AM toeesplitter.SplitLogger log
    INFO: JFileChooser: the chosen file is: C:\_WORLD BUILDER\Map14-dungeon-level-03_lower.bmp
    May 15, 2015 1:28:53 AM toeesplitter.SplitLogger log
    INFO: JFileChooser: the txt file is: C:\_WORLD BUILDER\Map14-dungeon-level-03_lower.txt
    May 15, 2015 1:28:53 AM toeesplitter.SplitLogger log
    INFO: Detected both the txt and the bmp file successfully.
    May 15, 2015 1:29:05 AM toeesplitter.SplitLogger log
    INFO: Split request received.
    May 15, 2015 1:29:05 AM toeesplitter.SplitLogger log
    INFO: SplitBMP: Internal folder name representation: C:\_WORLD BUILDER\Map14-dungeon-level-03_lower
    May 15, 2015 1:29:05 AM toeesplitter.SplitLogger log
    INFO: SplitBMP: Internal bmp name representation: C:\_WORLD BUILDER\Map14-dungeon-level-03_lower.bmp
    May 15, 2015 1:29:05 AM toeesplitter.SplitLogger log
    INFO: SplitBMP: Internal txt name representation: C:\_WORLD BUILDER\Map14-dungeon-level-03_lower.txt
    May 15, 2015 1:29:05 AM toeesplitter.SplitLogger log
    INFO: Loading the original image...
    Maybe the program can't handle the size of the BMP file or something, I'm not sure. But if this has been fixed in the last year let me know. Thanks.
     
  5. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Yeah, that was I believe an issue with an earlier build but Agetian resolved it. Something to do with Java and file size I think. I can post the newer version for you but it may be several days - I'm out of town and won't be back to my home PC for some time.
     
  6. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    Oh great, I'd appreciate it. Take all the time you need, there's no rush at all.
     
  7. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Here's the latest version. Sorry this took so long.

    I notice the date on the app isn't really recent, so please let me know if this doesn't work. If not, I must be mis-remembering something and we'll have to ask Agetian about it.
     

    Attached Files:

  8. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    This one appears to be the same as the one I already have, so it still isn't splitting the larger maps. I even did a Beyond Compare on them just to be sure. Both are:

    Name: ToEESplitter.jar
    Size: 19589
    Modified: 2014-04-26 00:49​

    Maybe this is in fact the newest one, and it just isn't working for me for some reason. But the small and medium sized maps are still splitting OK.

    Thanks.
     
  9. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    What OS are you using and what version of Java?
     
  10. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    Windows 8.1
    Java Version 8, Update 45
     
  11. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Okay, wracking my brain I seem to recall an issue with Java processing any files larger than something like 200 MB. (Obviously bitmap gets to that figure a lot quicker than jpeg would.)

    Now, in the case of the really huge Hommlet-size maps, you'd have to still split them into quads and process them part by part (see the 'well whaddya know' thread), but the maps that are close can actually be reduced in size with no actual quality loss by simply converting them to 24 bit if they're 32 bit. (32 bit bitmaps simply have an alpha channel, that's the only difference.)

    Does that work?
     
  12. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    I was actually toying with this earlier. I saved the Hommlet map as 32, 24, and then 16. None of them worked. Here are there sizes:

    32-bit: 600+ Meg
    24-bit: 454 Meg
    16-bit: 303 Meg

    However, if you think that 200 Meg is the cutoff range, I can actually squeeze my art onto a slightly smaller map to try to get under that 200 value. I picked the Hommlet map so there would be potential room for expansion off to the sides, but I think a smaller one can do.

    EDIT: just split Hickory Branch with it which is based on the Nulb map, and it was 161 Meg, so I got that far.

    If I fail there, I'll look into cutting it into quads and proceeding from there.

    Thanks, and I'll keep you posted...
     
  13. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    673
    Likes Received:
    110
    GOT IT! Oh man it looks nice.

    After testing, it appears the size limit for ToEESplitter.jar is about 160 MB, so none of the larger maps would work, as they were all 175 MB or higher, even at 24 bit. I tried 16 bit, but some of the areas looked funny so I finally kept the Hommlet-sized map and did a partial split into four chunks like you advised. Each quarter image just barely made it under the limit, being either 147 MB or 155 MB each.

    Thanks for providing those numbers in the "Well whaddya know" thread, it would have taken me forever to get them myself. It's the first post on this page if anyone ever reads this.

    Now I can just drag my giant BMP into Photoshop and split it into the four chunks by laying it over the four aligned Hommlet chunks, using each one as a selection in turn. Then I run each of the four through ToEESplitter.jar. After that Photoshop quickly converts them into JPGs with File > Scripts > Image Processor. The whole process takes about 20 minutes, but it worth it.

    Thanks for all the help, I'm very happy.
     
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Good stuff! :) Sorry it took so long. Also if I'd wracked my brain earlier you wouldn't have had to wait for the mystical new version of the splitter than didn't solve anything. ;)
     
Our Host!