Borders on portraits

Production of artwork for the game by regular contributors takes place here.

Moderator: Forum Moderators

Post Reply
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Borders on portraits

Post by turin »

Some of the portraits, such as those of Konrad and Delfador, have a small, 1 pixel border around them. However, most of them don't; see, for example, the Asheviere portrait.

Now, it seems to me we should have the same style for all of our portraits. So, do we want the border, or not? I suspect we do. If so, how would one go about adding the border to all the portraits that are missing it?
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Re: Borders on portraits

Post by Darth Fool »

turin wrote:Some of the portraits, such as those of Konrad and Delfador, have a small, 1 pixel border around them. However, most of them don't; see, for example, the Asheviere portrait.

Now, it seems to me we should have the same style for all of our portraits. So, do we want the border, or not? I suspect we do. If so, how would one go about adding the border to all the portraits that are missing it?
One word: ImageMagick.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

see http://www.wesnoth.org/forum/viewtopic. ... 4940#14940

In fact:

Code: Select all

#!/usr/bin/perl -w
use Image::Magick;

$filename = shift(@ARGV);

$image = new Image::Magick;
$image->Read($filename);
$width = $image->Get('width');
$height = $image->Get('height');
$nh=$height-2;
$nw=$width-2;
$Copt=$nw."x".$nh."+0+0";
$image->Mogrify('crop', $Copt);
$image->Border(geometry => '1x1' , fill => 'black');
$image->Write(filename=>$filename.".new", compress=>'None');
now just do something like this in bash:

Code: Select all

for i in $(ls data/campaigns/*/images/portraits/*.png data/core/images/portraits/*/*.png); do echo item: $i; ./image_border.pl $i; done
this will make copies of all the portraits with the bordered versions having .new added to their name. you could even do it in one fell swoop, but that will be left as an excercise for the reader.
Attachments
image_border.pl.gz
(270 Bytes) Downloaded 637 times
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

:? actually, for a lot of reasons, I'd like to see this border get applied programmatically, from within wesnoth.

These reasons include:
- changing the border for different themes (which would allow you to change the border used by all mainline units to match your campaign units); or even to use a different border for different sides.
- Adding it with ImageMagic is "yet another step" in the prep-for-game-usefulness process, and here, it requires that the person doing it have access to this resource (the border image).
- It also enforces a standard on third-party campaigns, etc, over which we have no ability to curate (without getting invasive, and editing the resources of UMCs on the campaign server). (We're assuming that in an advanced version of this, they could choose in WML to not use the standard border if they really didn't want to).
- In the future, it could be really nice to have a "display cropped section of a larger image" function - one that could display only the bust of a larger image during dialogue, but display the full version of the same image in a different dialogue.
- It would also allow us to improve the main border, and have it instantly get applied to all the current units portraits, without having to modify them.


Plus, we've clearly got the capability to do something along these lines, since it's effectively already done on our "list/tab buttons" (c.f. the left side of the options dialogue).
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

Jetryl wrote::? actually, for a lot of reasons, I'd like to see this border get applied programmatically, from within wesnoth.

These reasons include:
- changing the border for different themes (which would allow you to change the border used by all mainline units to match your campaign units); or even to use a different border for different sides.
- Adding it with ImageMagic is "yet another step" in the prep-for-game-usefulness process, and here, it requires that the person doing it have access to this resource (the border image).
- It also enforces a standard on third-party campaigns, etc, over which we have no ability to curate (without getting invasive, and editing the resources of UMCs on the campaign server). (We're assuming that in an advanced version of this, they could choose in WML to not use the standard border if they really didn't want to).
- In the future, it could be really nice to have a "display cropped section of a larger image" function - one that could display only the bust of a larger image during dialogue, but display the full version of the same image in a different dialogue.
- It would also allow us to improve the main border, and have it instantly get applied to all the current units portraits, without having to modify them.


Plus, we've clearly got the capability to do something along these lines, since it's effectively already done on our "list/tab buttons" (c.f. the left side of the options dialogue).
Well, I would like to see pretty much all these things be made into image path functions. If that was done, it would give you all the functionality that you want along with the flexibility for designers to make whatever adjustments they want.
Post Reply