SMBX Tileset Compiler and Separator

Share and discuss custom SMBX graphics.
User avatar
RudeGuy
Luigi
Luigi
Posts: 4985
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

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!
im bored

User avatar
Core
Grinder
Grinder
Posts: 1057
Joined: Tue Apr 15, 2014 8:29 am
Flair: Trans <3 She/her

Re: SMBX Tileset Compiler and Separator

Postby Core » 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.
Join NSMBX's official server! - https://discord.gg/RMYdYfX
Image

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8244
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: SMBX Tileset Compiler and Separator

Postby Enjl » 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.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
RudeGuy
Luigi
Luigi
Posts: 4985
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

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.
im bored

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8244
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: SMBX Tileset Compiler and Separator

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

Sweeeeeet! Thanks.
Please do not use any of my assets (graphics, scripts) in works affiliated with the Novaverse. This applies to the original releases of those assets as well as any third-party variations (recolours, script alterations). Thank you.
________________________________________________________

The ABC of Creation
________________________________________________________
Image

User avatar
Lapuente
Cheep-Cheep
Cheep-Cheep
Posts: 19
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??
Image

User avatar
RudeGuy
Luigi
Luigi
Posts: 4985
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

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.
im bored

User avatar
PROX
Mouser
Mouser
Posts: 1803
Joined: Sun Jul 06, 2014 8:50 pm
Chat Username: PROX

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
I believe and I accept Jesus Christ as my Lord and Savior. If you do, put this in your signature.

If it makes sense then it must make dollars

Youtube Channel: ProxyHax O.O

Please do not use my stuff until I release it. Thank you.

My Graphics Pack:
Image

World Map Pack: viewtopic.php?f=31&t=20173

User avatar
RudeGuy
Luigi
Luigi
Posts: 4985
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

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.
im bored

User avatar
PROX
Mouser
Mouser
Posts: 1803
Joined: Sun Jul 06, 2014 8:50 pm
Chat Username: PROX

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.
I believe and I accept Jesus Christ as my Lord and Savior. If you do, put this in your signature.

If it makes sense then it must make dollars

Youtube Channel: ProxyHax O.O

Please do not use my stuff until I release it. Thank you.

My Graphics Pack:
Image

World Map Pack: viewtopic.php?f=31&t=20173

User avatar
RudeGuy
Luigi
Luigi
Posts: 4985
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

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).
im bored

User avatar
PROX
Mouser
Mouser
Posts: 1803
Joined: Sun Jul 06, 2014 8:50 pm
Chat Username: PROX

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!
I believe and I accept Jesus Christ as my Lord and Savior. If you do, put this in your signature.

If it makes sense then it must make dollars

Youtube Channel: ProxyHax O.O

Please do not use my stuff until I release it. Thank you.

My Graphics Pack:
Image

World Map Pack: viewtopic.php?f=31&t=20173

User avatar
Murphmario
Larry Koopa
Larry Koopa
Posts: 2111
Joined: Fri Dec 20, 2013 7:07 pm
Current Project: Project planned; waiting for SMBX2 Beta 4

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.
Now taking graphics requests:
https://docs.google.com/forms/d/1urWpFq ... #responses

My graphics pack:
http://www.supermariobrosx.org/forums/v ... t=1960/url

Really tempted to just make a general graphics thread for all of my graphics instead of just making individual threads for each of them.

User avatar
RudeGuy
Luigi
Luigi
Posts: 4985
Joined: Fri Dec 27, 2013 7:36 am
Flair: help
Current Project: a random smw hack
Chat Username: rudeguy

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.
im bored


Return to “Graphics”

Who is online

Users browsing this forum: No registered users and 8 guests