Professor Nader "Welcome to the URealms Forums! Please make sure to read the rules before posting!
Your posting ability may be restricted for the first 24 hours!"

Automagically creating tile images with GIMP

edited May 2018 in Custom Tiles
***Updated

After creating a single tile, i realized that this process needed to be automated. I've created a utility to create tiles using GIMP. Extract the zip file and run the 'CreateURealmsTiles.exe' file and follow the on screen instructions. Below is a link to my github page where solution is stored. If you have problems, feel free to post. I'd like to get this part bug free before I tackle the rest of tile creation process.

https://github.com/Noogard64/CreateURealmsTiles/releases

****************EDIT

Please feel free to request features! Planned items include:
  • Automatically storing JSON file in tabletop simulator's saved object folder
  • Saving base circle image for showing the image in tabletop simulator saved objects UI
  • Different color backgrounds for tiles
Long term goal is to migrate from a console app to a more intuitive windows app.

**********************EDIT#2
The new version with a UI is done. Check it out here!
https://github.com/Noogard64/CreateURealmsTilesV2/releases/

Thanks!
«134

Comments

  • Yes, thank you this will be great! I’ll probably test it out a bit later when I can.
  • This works pretty well. Thank you so much. :D
  • You are a scholar and an upstanding community member!
  • Wow, yeah I really couldn't compliment this enough! It's just so great to not have to do all the statuses by hand, and instead just have to run that with whatever character tile image I want. Great work! <3
  • If I had the first clue how to make anything like this I would make one that puts whatever image you want onto a few of the different background colors for the tiles. In fact, I am probably going to try and learn how to do that soon, it would make it so that with both this and the previously mentioned idea, you could easily make a variety of tiles for any image you want with ease! 
  • @Lucius_E Do you mean the different color backgrounds on the tiles? I don't think it would be difficult to do that. The input image would need to be formatted to work with that though.
  • @Noogard64 Yeah the different color backgrounds, red, blue, green, etc. I often like to have my tiles with each different color background just in the case I need to use the same kind of tile many times and want to be able to tell the difference between each one. 

    I didnt think it would be hard to do at all, so that’s why I thought it would be cool for me to try and learn how to do. Right now I still haven’t the first clue how to do that, but I gotta start somewhere.
  • @Lucius_E The best way to learn it is looking at the code on GitHub. I think I documented it pretty well, so it should be easy to follow.
  • I'll have to look into GitHub. I have never really heard of it until now. So far, looking around I haven't really understood how to do anything on it. 
  • I am having an issue. My GIMP isn't installed in the D drive of my computer. I did change the search way in the bat to it, but I get these two errors; 1. If I just run it it will say there is no GIMP file or folder in the CreateURealmsTileImages-master folder (?) and making a folder named GIMP makes it instead say it doesn't have permission to use it. 2. Running it as an admin makes it instead moaning about me not having a GIMP folder in the C drive. Mark that both those errors come up after I selected an image to use, so the initial start up works. Got any idea how I can fix it on my end?
  • edited March 2018
    @JackOfTheFlames ;
     Where is GIMP installed? I think if you updated line 10 in the runApp.bat you may be good to go. Try changing "C:\Program Files\GIMP 2\bin\gimp-2.8.exe" to where your gimp-2.8.exe is. Also, can you post a screenshot of the error?
  • I did change that. and I will grab you the screenshots, 2 mins
  • Actually, since it shows in swedish I'll instead just write it.
    First running(no admin)
    GIMP-error: opening of "D:\xx\xx\xx\CreateURealmsTileImages-master\gimp" failed: Permission denied.
    Batch command experienced an execution error
    (press any key to close down the window)
    2nd running(admin):
    GIMP-error: opening of "C:\WINDOWS\system32\gimp" failed: No such file or directory
    Batch command experienced an execution error
    (press any key to close down the window)
  • edited March 2018
    @JackOfTheFlames ;What's the filepath for your Gimp executable? Maybe some special characters in the path? I have an idea on how to fix it on my side, but I won't be able to do it until this evening.
  • edited March 2018
    no special letters, but a space gimp created by itself. D:\blandat\GIMP 2\bin followed by the exe file
  • Did you replace exactly like this?

    Before:
    "C:\Program Files\GIMP 2\bin\gimp-2.8.exe"

    After"
    "D:\blandat\GIMP 2\bin\gimp-2.8.exe"
  • Can you copy and paste the contents of your bat file? This is really bugging me...
  • BTW! I did realize earlier that I had put in the adress wrong the first few attempts, but correcting it still caused the same error message.

    <# : chooser.bat
    :: launches a File... Open sort of file chooser and outputs choice(s) to the console

    @echo off
    setlocal

    for /f "delims=" %%I in ('powershell -noprofile "iex (${%~f0} | out-string)"') do (
        echo Starting process for %%~I
    "D:\blandat\GIMP 2\bin\gimp-2.8.exe" gimp -idf --batch-interpreter=python-fu-eval -b "import sys; sys.path =['.'] + sys.path; import batch_CreateURealmsTileImages; batch_CreateURealmsTileImages.run('%%~I')" -b "pdb.gimp_quit(1)"
    )
    Pause
    goto :EOF

    Print $f.FileName


    : end Batch portion / begin PowerShell hybrid chimera #>

    Add-Type -AssemblyName System.Windows.Forms
    $f = new-object Windows.Forms.OpenFileDialog
    $f.InitialDirectory = pwd
    $f.Filter = "PNG Files (*.png)|*.png"
    $f.ShowHelp = $true
    $f.Multiselect = $true
    [void]$f.ShowDialog()
    if ($f.Multiselect) { $f.FileNames } else { $f.FileName }


  • @JackOfTheFlames ;
     Nothing looks wrong there. I added a bunch of logging. Update and try again. This may help pinpoint the issue.
  • edited March 2018
    now it cannot find the way to the image.. ^^*
  • What's the error say exactly?
  • Added verbose logging and try/catches all over the python script. maybe we can get something from that.
  • the error said it couldn't find the location pretty much. And everything was A-Z, so it wasn't due to unfamiliar letters. I'll grab the new one( if the Added verbose is new) and try again. Might be tomorrow thou', net being dumb
  • edited March 2018
    ´still says it cannot find the "search way" to my selected .PNG file. And I did try pictures from both of my drives, no difference.
  • Post a screenshot please.

  • The Swedish line translates to "It isn't possible to find the search way."
  • edited March 2018
    So you run the .bat file and it prompts you to find the file. You select a file, click OK, and then the error appears? Does a GIMP console window appear?
  • No GIMP window comes up. Before the first time I updated from github(aka my first download) there were a 2nd window that would come up, but I am not sure if it were a GIMP console. It looked exactly like the one I screenshot but with another name
  • Ok. Have you opened GIMP prior to using the script?
Sign In or Register to comment.