Wesnoth-TC: new tool for artists (Qt4 UI needs betatesters!)

Contribute art for mainline Wesnoth.

Moderator: Forum Moderators

Forum rules
Before posting critique in this forum, you must read the following thread:
User avatar
Iris
Site Administrator
Posts: 6796
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Wesnoth-TC: new tool for artists (Qt4 UI needs betatesters!)

Post by Iris »

Wesnoth-TC is a command-line utility that takes a PNG file (or a list of them) as argument and iterates over each one creating separate, team-colorized copies. For instance, wesnoth-tc foo.png creates foo-TC-1.png, foo-TC-2.png, etc., where [1-9] are the default side numbers corresponding to the default team colors (1 = red, 2 = blue, etc.).

Wesnoth-TC can be used to team-colorize units with the magenta key, or flags with the flag_rgb key. It all depends on the parameters you pass to it, with the default source palette being the magenta key, and targets, the different team colors. You can also define your own color ranges and key palettes if you want to.

The latest version is 1.5.1, and can be downloaded from this page in my website, or alternatively, from SourceForge.net.

The distribution includes the full source code, partially taken from the mainline engine, and a sample image that is your generic magenta key swatch, taken from our wiki. For more details on using and installing, read the included README and INSTALL files, respectively.

I'd be particularly interested in seeing a (hopefully cross-platform) GUI frontend to this program so that it is more useful to our less tech-savvy artists.

EDIT: since my website is currently disabled due to funding issues, use the SF.net link instead.
Last edited by Iris on July 31st, 2012, 5:02 am, edited 9 times in total.
Reason: Added SF.net project link
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
thespaceinvader
Retired Art Director
Posts: 8414
Joined: August 25th, 2007, 10:12 am
Location: Oxford, UK
Contact:

Re: Wesnoth-TC: new tool for artists

Post by thespaceinvader »

Awesome.

I share your hope that this will be ported to windows =) I'd do so if I were capable.
http://thespaceinvader.co.uk | http://thespaceinvader.deviantart.com
Back to work. Current projects: Catching up on commits. Picking Meridia back up. Sprite animations, many and varied.
User avatar
Iris
Site Administrator
Posts: 6796
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Wesnoth-TC: new tool for artists

Post by Iris »

AI just reported compilation errors on libc 2.8. Release 1.0.0a fixes them.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
penguin
macOS Packager
Posts: 239
Joined: April 17th, 2004, 5:16 pm
Location: Ontario, Canada
Contact:

Re: Wesnoth-TC: new tool for artists

Post by penguin »

I've made an initial version of a Mac interface. There's a couple things it's missing, like the ability to actually save files, but that can be added later. Please let me know what features you would actually use.

Download: Wesnoth_TC_1.0.zip
Attachments
wesnoth_tc_window.png
Last edited by penguin on August 10th, 2009, 4:53 pm, edited 1 time in total.
Reason: Add screenshot
User avatar
Iris
Site Administrator
Posts: 6796
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Wesnoth-TC: new tool for artists

Post by Iris »

And now with a git repository:

http://gitorious.org/wesnoth-tc

I'll be cleaning up a lot of the source code of the command line based tool and adding a ~PAL()-like conversion.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
A-Red
Art Contributor
Posts: 495
Joined: May 6th, 2009, 1:21 am

Re: Wesnoth-TC: new tool for artists

Post by A-Red »

For those of us who don't yet have a good grasp on the technical aspects of the game and its use of art, what would this app be used for? My understanding is that units can be recolored with WML (eg Tallin).
Sangel
Moderator Emeritus
Posts: 2232
Joined: March 26th, 2004, 10:58 pm
Location: New York, New York

Re: Wesnoth-TC: new tool for artists

Post by Sangel »

A-Red wrote:For those of us who don't yet have a good grasp on the technical aspects of the game and its use of art, what would this app be used for? My understanding is that units can be recolored with WML (eg Tallin).
I assume it's designed so that you can see the effects of your team colour work, while you're working on the sprite, without having to load it up into Wesnoth.
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: Wesnoth-TC: new tool for artists

Post by Boucman »

will you add animation support ? :P
Fight key loggers: write some perl using vim
User avatar
Iris
Site Administrator
Posts: 6796
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Wesnoth-TC: new tool for artists

Post by Iris »

Sangel wrote:I assume it's designed so that you can see the effects of your team colour work, while you're working on the sprite, without having to load it up into Wesnoth.
Exactly.
Boucman wrote:will you add animation support ? :P
It's a command line tool...
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Re: Wesnoth-TC: new tool for artists

Post by Jetrel »

@shadowmaster: I'm not sure penguin informed you, but we've discovered a major endian issue with this (we don't know specifically what's causing it, unless he discovered something after I left). Basically, this doesn't work on PPC - it just passes-through the image without changing it.

Since I have a PPC, that naturally leaves me out in the cold. :augh: I was actually trying to use this for a drake image, and had an ugly surprise.
Boucman wrote:will you add animation support ? :P
That would be very counter-productive, actually. The point of this tool is to produce a single image of a single frame, so you can spend some deep-time (at least 10-30 seconds) poring over the image and making sure you didn't miss any TC pixels. Usually, you TC an image to blue with this tool, since that's so radically different from the magenta.

So, looking at an animation would be useless, because we wouldn't have enough time to study the image and see any offending pixels.

A side use is just seeing what the thing looks like, the primary use is the above. The reason is that loading wesnoth is a [censored]; wesnoth is a bloated space cow that takes a long time to launch - also, scripting the image into the WML is awkward. With this tool, especially when packaged by crimson_penguin with a nice drag-and-drop gui, it's really quick to check.
Play Frogatto & Friends - a finished, open-source adventure game!
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Wesnoth-TC: new tool for artists

Post by AI »

Having taken a quick look, there's a ton of shifting to separate 32bit RGBA into its components and then throw them back together. Haven't read all of the code yet, but a quick (and ugly) fix could be to abuse htonl() and ntohl(). I only have access to i386-based systems though, so I can't test whether it works.
User avatar
solsword
Code Contributor
Posts: 291
Joined: January 12th, 2009, 10:21 pm
Location: Santa Cruz, CA
Contact:

Re: Wesnoth-TC: new tool for artists

Post by solsword »

Also, the TeamColorizer Python script in data/tools/unit_tree/ should (as of r38796) use the same algorithm as Wesnoth proper, and it also now supports picking a color instead of just red (you can even use custom colors if you want). If you're just looking for a command-line tool to use while spriting, that ought to suffice. If *that* has endian issues (which I strongly doubt, since it's basically just a thin front-end to a complicated convert invocation), let me know and I'll do my best to fix it up.
The Knights of the Silver Spire campaign.

http://www.cs.hmc.edu/~pmawhorter - my website.

Teamcolors for everyone! PM me for a teamcolored version of your sprite, or you can do it yourself. If you just happen to like magenta, no hard feelings?
User avatar
Iris
Site Administrator
Posts: 6796
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Wesnoth-TC: new tool for artists

Post by Iris »

AI wrote:Having taken a quick look, there's a ton of shifting to separate 32bit RGBA into its components and then throw them back together. Haven't read all of the code yet, but a quick (and ugly) fix could be to abuse htonl() and ntohl(). I only have access to i386-based systems though, so I can't test whether it works.
The online git repository's HEAD should contain a fix for the big-endian problem. But I need someone with a PowerPC Linux or MacOS X platform (with an adequate development environment) to test so I can release 1.5.0.

It also supports plain palette switches now (similar to the game's ~PAL image function), which is great since it already showed me some problems in my palette-switching sprites. :annoyed:
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Re: Wesnoth-TC: new tool for artists

Post by Jetrel »

Awesome. Crimson-penguin mentioned to me that you wanted a machine to act as a testbed, and that we can set up my machine as a target to compile to (or his). In either case; we'll probably need him around to help, so we'll see if the three of us can't convene on IRC over the next few days.
Play Frogatto & Friends - a finished, open-source adventure game!
BroodKiller
Posts: 30
Joined: August 12th, 2008, 9:24 pm

Re: Wesnoth-TC: new tool for artists

Post by BroodKiller »

I set out and designed a very simple interface around v1.0.0a. As you can see, it's a Win32 port, but I used wxWidgets with the libpng devels, so it should hopefully be fully x-platform, once I finish it. I am currently interfacing it with the program's core - I'm thinking about composing an emulated command line and passing it to the main routine, but it turned out to be more complex than I thought. I'll probably have to strip the source from all the cerr's cout's etc. Any chances you could help me out somehow with this? Or maybe make a dll out of it?
WTC_GUI.gif
WTC_GUI.gif (26.34 KiB) Viewed 10122 times
Clean...Simple...Devious...I like it
Post Reply