Solarus Forum

Community => General discussion => Topic started by: froggy77 on July 04, 2019, 12:15:46 am

Title: GIMP - python-fu for pixel art - tileset extractor
Post by: froggy77 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. (http://forum.solarus-games.org/index.php?action=dlattach;topic=1351.0;attach=795)

What is this kind of script?
It is explained here: https://docs.gimp.org/en/gimp-filters-python-fu.html (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 (https://vgmaps.com/Atlas/GB-GBC/LegendOfZelda-Link'sAwakening-Koholint.png) 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").


(http://froggy.web.pagesperso-orange.fr/gimp/script_tileset_extractor_demo.gif)
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: Neovyse on July 05, 2019, 11:33:38 am
Excellent!
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: froggy77 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.
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: wrightmat 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 :(
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: wrightmat 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.
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: froggy77 on July 07, 2019, 12:30:12 pm
Does it work properly now you use version 2.10 of Gimp?
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: wrightmat on July 08, 2019, 01:27:09 am
Yes - works great!
Title: Re: GIMP - python-fu for pixel art - tileset extractor
Post by: froggy77 on July 08, 2019, 05:53:58 pm
So kewl!  :)