SMBX Tileset Compiler and Separator

Share and discuss custom SMBX graphics.
RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Sat May 18, 2019 11:20 am

...Hey. Am I the only one to think this tool is a little bit rudimentary?
No?
Whatever, I had fun.
Around two weeks ago I asked FrozenQuills for the source code of this thing and decided to edit it, just to add some more functionality and make my life easier. What turned out is this new version:
Download the SMBX Image Compiler Version 1.2!
Source code download

Now, this version doesn't really add too much functionality if you just run the exe, outside of asking whether you want to compile or separe images, asking the extension to use and making fewer files when running it, but if you are a bit more experienced with the command line, you may like the fact that I've added some arguments to use. The arguments are these:
Spoiler: show
-c, --compile: Compiles the images in the folder specified by --edit-folder. When --edit-folder is not specified, it will use a folder called "edit", located in the program's directory.
-s, --separe: Separates the images in the folder specified by --joined-folder. When --joined-folder is not specified, it will use the image found in the program's directory (if it finds it).
-e, --extension [Either 'png' or 'gif']: The extension to use.
-ef, --edit-folder [Path to the folder]: Choose the folder of the images to join. Default is ./edit. This option is ignored if separing images. This option accepts more than one folder.
-jf , --joined-folder [Path to the folder]: Choose the folder where to save the big image cointaining the joined images. Default folder is the program's directory.
-of, --output-folder [Path to the folder]: Choose the folder where the separated images appear. Default is ./output. This option is ignored if compiling images.
-n, --name: The name to give to the big, compiled image. Default is "joinedImages".

Combining these arguments, one can do

Code: Select all

> smbx-image-compiler.exe -c -e png -ef /path/to/gfx /path/to/other/gfx -jf /some/random/folder -n tilesetgfx1
to get any graphics from both /path/to/gfx and /path/to/other/gfx and directly put the big compiled image into /some/random/folder with the name tilesetgfx1.png. Then you can separe like this:

Code: Select all

> smbx-image-compiler.exe -s -e png -of /level/folder -jf /some/random/folder -n tilesetgfx1
To get the compiled image from /some/random/folder and separe it directly into your level folder. If you can learn it, this can save you some time from having to copy the images you want, browsing to where you placed the program and later having to copy them again, as well having to always rename the images if you have multiple tilesets to recolor.
If you don't want to do everything this way, though, it's all fine. As I said, the old way of using this tool hasn't changed too much. (also, it's worth noting that this version might have fixed some bugs still present in older versions. Only when I got the source code could I run the 1.1 version correctly)

All that said, if any of you has any feature to suggest, I'll be more than happy to add it!
Last edited by MrDoubleA on Wed Jul 13, 2022 11:36 am, edited 1 time in total.
Reason: Update download links to non-dead versions

KateBulka
Fuzzy
Fuzzy
Posts: 1111
Joined: Tue Apr 15, 2014 8:29 am
Flair: Bun~
Pronouns: she/her

Re: SMBX Tileset Compiler and Separator

Postby KateBulka » Sat May 18, 2019 1:50 pm

Well that's some neat stuff, but i don't use it because i just realized this tool exsits lol. I will try it out some time heh.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9718
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: SMBX Tileset Compiler and Separator

Postby Emral » Sat May 18, 2019 2:58 pm

Can you make the program autogenerate a palette in the corner of the combined image? I might start using it again if it gave me an option to view all colours easily.

RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Mon May 20, 2019 2:59 pm

Enjl wrote:
Sat May 18, 2019 2:58 pm
Can you make the program autogenerate a palette in the corner of the combined image? I might start using it again if it gave me an option to view all colours easily.
First off, great suggestion. Exe + source
It doesn't have support for gif files and honestly I've kinda rushed into making it, but it should work well for png.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9718
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: SMBX Tileset Compiler and Separator

Postby Emral » Mon May 20, 2019 3:43 pm

Sweeeeeet! Thanks.

Lapuente
Rex
Rex
Posts: 31
Joined: Mon Dec 28, 2015 12:18 pm

Re: SMBX Tileset Compiler and Separator

Postby Lapuente » Sat Jul 06, 2019 8:02 am

do graphics work the same in SMBX 1.4/5 and in SMBX 2??

RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Sat Jul 06, 2019 8:19 am

Lapuente wrote:
Sat Jul 06, 2019 8:02 am
do graphics work the same in SMBX 1.4/5 and in SMBX 2??
i never looked into smbx 38A (what you refer as 1.4/5) but i'm pretty sure it also uses pngs.
either way, it doesn't matter. this program can do both gifs and pngs.

PROX
Banned
Posts: 1953
Joined: Sun Jul 06, 2014 8:50 pm

Re: SMBX Tileset Compiler and Separator

Postby PROX » Tue Sep 17, 2019 3:15 pm

Now if only we had a tool that made importing graphics faster. Maybe then I wouldn't be so afraid to make huge spritesheets

RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Fri Oct 04, 2019 10:51 am

PROX wrote:
Tue Sep 17, 2019 3:15 pm
Now if only we had a tool that made importing graphics faster. Maybe then I wouldn't be so afraid to make huge spritesheets
Hey sorry for replying after so long.
I've thought about this for some time and got to the conclusion that a perfect importing tool would impossible , or at least difficult to do in my skill level (mostly due to how different spritesheets can be with each other. one can have 32x32 blocks only, one 64x64, another can have various blocks of different sizes... you'd have to figure out where the various images are, which can be difficult)... well, unless we put in a few restrictions. I came to two solutions:
  • If you've ever used this tool, then you've probably noticed that it creates a .txt file along with the image. What this .txt file contains is the names of the images and their sizes, which it uses to separe later. We could use this file for something more: specify where the images are located in the spritesheet, what their size is and so on. This would however require people to do more work than what they should. Which brings me to the next solution:
  • Restrict how the spritesheet should be laid out, so that we can quickly import tiles without too much difficulty. You'd be required to create a spritesheet of 32x32 squares only (or something along those lines), but then you'd just need to run this tool once and all your graphics will be ready.
I'm thinking of implementing the second solution, along with fixing a few other things. Let me know if you (or someone else) can think of a better way.

PROX
Banned
Posts: 1953
Joined: Sun Jul 06, 2014 8:50 pm

Re: SMBX Tileset Compiler and Separator

Postby PROX » Sat Oct 05, 2019 10:36 pm

RudeGuy wrote:
Fri Oct 04, 2019 10:51 am
PROX wrote:
Tue Sep 17, 2019 3:15 pm
Now if only we had a tool that made importing graphics faster. Maybe then I wouldn't be so afraid to make huge spritesheets
Hey sorry for replying after so long.
I've thought about this for some time and got to the conclusion that a perfect importing tool would impossible , or at least difficult to do in my skill level (mostly due to how different spritesheets can be with each other. one can have 32x32 blocks only, one 64x64, another can have various blocks of different sizes... you'd have to figure out where the various images are, which can be difficult)... well, unless we put in a few restrictions. I came to two solutions:
  • If you've ever used this tool, then you've probably noticed that it creates a .txt file along with the image. What this .txt file contains is the names of the images and their sizes, which it uses to separe later. We could use this file for something more: specify where the images are located in the spritesheet, what their size is and so on. This would however require people to do more work than what they should. Which brings me to the next solution:
  • Restrict how the spritesheet should be laid out, so that we can quickly import tiles without too much difficulty. You'd be required to create a spritesheet of 32x32 squares only (or something along those lines), but then you'd just need to run this tool once and all your graphics will be ready.
I'm thinking of implementing the second solution, along with fixing a few other things. Let me know if you (or someone else) can think of a better way.
I can totally get behind the second idea.

RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Thu Nov 28, 2019 11:19 am

PROX wrote:
Sat Oct 05, 2019 10:36 pm
I can totally get behind the second idea.
Well, sorry for taking so long, again. This time I've worked very hard on this program, so hard in fact, I've probably made it way too powerful for such a small program.
Anyway, I've finally finished it! This new version has support for spritesheet just like how I've described + a lot of bugfixes and improvements. You can do more than just joining/separing images now, you can now import spritesheets, quickly resize images, quickly get their palette (which was improved a lot, by the way)... And since the name "SMBX Image Compiler" doesn't really make too much sense now, I've decided to rename it to "SMBX Image Tool" (for stuff you can't do as quickly in whatever image editor you have).

I've also worked on a better and faster interface:
Spoiler: show
Image
Now, remember that this tool is a command-line application. If you can use the command line, there is some more stuff you can do. Here's a mini tutorial:
Spoiler: show
First off, remember you can see every argument by passing -h. A lot of arguments are changed, you can see all the new ones there.

You can join or separe images from a directory called "dir" to a directory called "output" by writing these:

Code: Select all

smbx-image-tool --join images --input-dir dir --output-dir output
smbx-image-tool --separe --input-dir output --output-dir dir
--join takes as argument either "image" or "spritesheet". For --separe, it doesn't matter. Note that you can actually join and separe at the same time... intentionally so. But it's probably not a very good idea.

You can join images into a spritesheet like so:

Code: Select all

smbx-image-tool --join spritesheet --input-dir dir --output-dir output --spritesheet-width 4 --spritesheet-height 4 --image-width 32 --image-height 32
You can also separe a spritesheet without a .cfg file, by passing --image-width and --image-height:

Code: Select all

smbx-image-tool --separe --input-dir output --output-dir dir --image-width 32 --image-height 32
You can also skip joining/separing and simply do some operations on the images (like resizing):

Code: Select all

smbx-image-tool --no-join-or-separe --resize 50 --separe-palette --input-dir dir --same-dir
Lastly, you can filter what images are taken by specifying --image-width, --image-height or --input-name:

Code: Select all

smbx-image-tool --join images --input-dir dir --output-dir output --image-width 32 --image-height 32 --input-name background-*
Now, without further ado, here's the Download.
Here's the source code, if anyone cares (warning: probably shitty).

PROX
Banned
Posts: 1953
Joined: Sun Jul 06, 2014 8:50 pm

Re: SMBX Tileset Compiler and Separator

Postby PROX » Fri Nov 29, 2019 4:29 am

Oh nice! I'll be sure to try this out!

Murphmario
Chargin' Chuck
Chargin' Chuck
Posts: 2382
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: SMBX Tileset Compiler and Separator

Postby Murphmario » Sun Dec 22, 2019 5:31 pm

This seems to have issues with SMBX2 content. I'm running Windows 10, if that helps.

RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Tue Dec 24, 2019 12:31 pm

Murphmario wrote:
Sun Dec 22, 2019 5:31 pm
This seems to have issues with SMBX2 content. I'm running Windows 10, if that helps.
try downloading again now. if there are still some errors, copy whatever it says and post it in this thread.

Murphmario
Chargin' Chuck
Chargin' Chuck
Posts: 2382
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: SMBX Tileset Compiler and Separator

Postby Murphmario » Tue Jun 02, 2020 12:14 am

RudeGuy wrote:
Sat May 18, 2019 11:20 am
...Hey. Am I the only one to think this tool is a little bit rudimentary?
No?
Whatever, I had fun.
Around two weeks ago I asked FrozenQuills for the source code of this thing and decided to edit it, just to add some more functionality and make my life easier. What turned out is this new version:
Download the SMBX Image Compiler Version 1.2!
Source code download

Now, this version doesn't really add too much functionality if you just run the exe, outside of asking whether you want to compile or separe images, asking the extension to use and making fewer files when running it, but if you are a bit more experienced with the command line, you may like the fact that I've added some arguments to use. The arguments are these:
Spoiler: show
-c, --compile: Compiles the images in the folder specified by --edit-folder. When --edit-folder is not specified, it will use a folder called "edit", located in the program's directory.
-s, --separe: Separates the images in the folder specified by --joined-folder. When --joined-folder is not specified, it will use the image found in the program's directory (if it finds it).
-e, --extension [Either 'png' or 'gif']: The extension to use.
-ef, --edit-folder [Path to the folder]: Choose the folder of the images to join. Default is ./edit. This option is ignored if separing images. This option accepts more than one folder.
-jf , --joined-folder [Path to the folder]: Choose the folder where to save the big image cointaining the joined images. Default folder is the program's directory.
-of, --output-folder [Path to the folder]: Choose the folder where the separated images appear. Default is ./output. This option is ignored if compiling images.
-n, --name: The name to give to the big, compiled image. Default is "joinedImages".

Combining these arguments, one can do

Code: Select all

> smbx-image-compiler.exe -c -e png -ef /path/to/gfx /path/to/other/gfx -jf /some/random/folder -n tilesetgfx1
to get any graphics from both /path/to/gfx and /path/to/other/gfx and directly put the big compiled image into /some/random/folder with the name tilesetgfx1.png. Then you can separe like this:

Code: Select all

> smbx-image-compiler.exe -s -e png -of /level/folder -jf /some/random/folder -n tilesetgfx1
To get the compiled image from /some/random/folder and separe it directly into your level folder. If you can learn it, this can save you some time from having to copy the images you want, browsing to where you placed the program and later having to copy them again, as well having to always rename the images if you have multiple tilesets to recolor.
If you don't want to do everything this way, though, it's all fine. As I said, the old way of using this tool hasn't changed too much. (also, it's worth noting that this version might have fixed some bugs still present in older versions. Only when I got the source code could I run the 1.1 version correctly)

All that said, if any of you has any feature to suggest, I'll be more than happy to add it!
Hey, think you can take this out of the trash and have working links again?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9718
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: SMBX Tileset Compiler and Separator

Postby Emral » Tue Jun 02, 2020 12:52 am

Murphmario wrote:
Tue Jun 02, 2020 12:14 am
Hey, think you can take this out of the trash and have working links again?
The links in the post you linked work. I just tried them to confirm.

Murphmario
Chargin' Chuck
Chargin' Chuck
Posts: 2382
Joined: Fri Dec 20, 2013 7:07 pm
Pronouns: he/him

Re: SMBX Tileset Compiler and Separator

Postby Murphmario » Tue Jun 02, 2020 1:02 am

Enjl wrote:
Tue Jun 02, 2020 12:52 am
Murphmario wrote:
Tue Jun 02, 2020 12:14 am
Hey, think you can take this out of the trash and have working links again?
The links in the post you linked work. I just tried them to confirm.
They don't work for me; both of them say that the files were trashed, with no option to download.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9718
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: SMBX Tileset Compiler and Separator

Postby Emral » Tue Jun 02, 2020 1:07 am

Murphmario wrote:
Tue Jun 02, 2020 1:02 am
Enjl wrote:
Tue Jun 02, 2020 12:52 am
Murphmario wrote:
Tue Jun 02, 2020 12:14 am
Hey, think you can take this out of the trash and have working links again?
The links in the post you linked work. I just tried them to confirm.
They don't work for me; both of them say that the files were trashed, with no option to download.
Oh, hm. Looks like my browser still had the page cached or something. You're right.
Here, I made a temporary archive of the actual program until new proper links are provided:
https://drive.google.com/file/d/1AxW7Be ... sp=sharing

RudeGuy
Fry Guy
Fry Guy
Posts: 4993
Joined: Fri Dec 27, 2013 7:36 am
Flair: local guy

Re: SMBX Tileset Compiler and Separator

Postby RudeGuy » Sat Jun 06, 2020 4:28 pm

Huh, that's weird.
Here's a working link: https://drive.google.com/file/d/1lmUcTe ... sp=sharing

georgespezi12
Dolphin
Dolphin
Posts: 99
Joined: Mon Jun 01, 2020 3:45 am

Re: SMBX Tileset Compiler and Separator

Postby georgespezi12 » Sun Aug 30, 2020 5:53 pm

It doesn't work with png files without transparencies

Added in 2 minutes 3 seconds:
It generates error log when it tries to work with a PNG graphic that doesnt have empty space - for example fill tiles.


Return to “Graphics”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari