Author Topic: GIMP - python-fu for pixel art - tileset extractor  (Read 1427 times)

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
GIMP - python-fu for pixel art - tileset extractor
« on: July 04, 2019, 12:15:46 am »
Hello,

Here is in the attached file a python script to add in GIMP. It is supposed to be useful for pixel artists but also for those who rip game maps.

This one is not a Script-Fu, but a Python-Fu. My first script in Python... :)  This is a beta version, I hope there will be not too many bugs. Please save your work before. Don't hesitate to report bugs.

See attachment file.

What is this kind of script?
It is explained here: https://docs.gimp.org/en/gimp-filters-python-fu.html


Where to copy it?
Unzip the folder before to copy it the right place.There are often two directories. You can find their path in:
"Edit" > "Preferences" > "Folders" > "Plug-Ins"


Some explanations
- It appears in the menu /Filters/pixelart-tileset-extractor of GIMP
- It extracts tiles from a tilemap to build quicker a tileset. This excludes tiles from the existing tileset, if any.

Example:
1 min 20 to extract the tiles from this image of 2560x2048 pixels (this represents 20480 tiles of 16px). Here, there is no existing tileset (so it is the layer's name that appears). If there was a tileset, I should have selected it (in "Tileset:")  and tiles already known would have been excluded from the created tileset ("New tileset").


« Last Edit: July 04, 2019, 09:28:59 am by froggy77 »

Neovyse

  • Administrator
  • Full Member
  • *****
  • Posts: 155
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #1 on: July 05, 2019, 11:33:38 am »
Excellent!

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #2 on: July 05, 2019, 11:04:50 pm »
Thank you. As I said on Discord, don't hesitate to ask if you have questions about the script. There may be things to change, add or improve.

wrightmat

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #3 on: July 06, 2019, 06:41:04 pm »
I copied the file to my plugins folder, and restarted Gimp, but I don't see anything new in my Filters menu. Is there a step I'm missing?

Ran Gimp in verbose mode, but didn't give much insight. "Unable to run plug-in. Failed to execute child process (No such file or directory)." No line number or routine or anything :(
« Last Edit: July 06, 2019, 07:35:35 pm by wrightmat »

wrightmat

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #4 on: July 06, 2019, 07:55:22 pm »
Nevermind. I was running an old version of Gimp and didn't even realize it until I checked the script comment that said it was tested in 2.10.

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #5 on: July 07, 2019, 12:30:12 pm »
Does it work properly now you use version 2.10 of Gimp?

wrightmat

  • Sr. Member
  • ****
  • Posts: 259
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #6 on: July 08, 2019, 01:27:09 am »
Yes - works great!

froggy77

  • Full Member
  • ***
  • Posts: 137
    • View Profile
Re: GIMP - python-fu for pixel art - tileset extractor
« Reply #7 on: July 08, 2019, 05:53:58 pm »
So kewl!  :)