|
|
|
|
Re: Usermade Faces Data Bank[message #296476]
|
Tue, 10 January 2012 00:16
|
|
Kazuya |
|
Messages:208
Registered:January 2009 |
|
|
Hachiryoku
What I could really use is someone who wouldn't mind taking a base picture and giving it JA2 color via a better program.
Kazuyas rare and legendary skin_tool of the crystal ages +5, can do what you are looking for. I haven't released it yet, because I never got around to tidy up the code. Although I have used it for quite some time now. Back then, I just started writing with a basic idea in mind and I kept rewriting it, until it did what I wanted it to do, so don't complain about some unusual or weired parts in the code.
My basic idea is this: I transplant the skin of an existing JA2 character onto a grayscale picture of a new character. I simply take a JA2 picture and paint all parts, that are not skin pitch black. This file becomes the donor file. Then I grayscale a picture of my new character and cut out everything that is not skin. I paste that cut out into a new rgb image with a fully black background. This file becomes the recipient file. My script then traverses all pixels in the donor file and saves all different rgb values, except for fully black. All rgb values get a luminance value assigned. Then it does the same thing with the recipient file. When this is done, my script calculates a color table, which assigns every luminance value of the gray picture the closest matching luminance value of the colored picture. By doing this, every rgb value of the grayscale picture has now a real rgb value of the coloured picture. The script then runs a second time over the grayscale picture and paints every pixel in its newly assigned skincolor and finally saves it as a seperate file. Then you can paste the new skin over your original character and do whatever you want to do with the clothing and hair etc. My tool is written in python and needs a python environment as well as the pygame module. Both can be downloaded for free. So here is the source code:
Toggle Spoiler
import pygame,os
os.environ['SDL_VIDEODRIVER']='windib'
pygame.init()
#screen = pygame.display.set_mode((30,30))
def append_color(rgba,rgb_list):
r,g,b,a=rgba
rgb=r,g,b
if not(rgb in rgb_list):
rgb_list.append(rgb)
return rgb_list
def skin_color_list(skin_file):
x=pygame.image.load(skin_file)
color_list=[(0,0,0)]
a=x.get_width()
b=x.get_height()
for i in range(0,a,1):
for j in range(0,b,1):
color=x.get_at((i,j))
color_list=append_color(color,color_list)
del(color_list[0])
return color_list
def get_lumina((r,g,b)):
return (0.3*r+0.59*g+0.11*b)
def get_closest_value(value,lumina_list):
lumi_diff=257
lumi_value=get_lumina(value)
pointer=0
for i in lumina_list:
if abs(lumi_value-i)(0,0,0,255):
rgb=color_table[color[0]]
result.set_at((i,j),rgb)
pygame.image.save(result,"test.png")
def run(donor_file,recipient_file):
donor_list=skin_color_list(donor_file)
recipient_list=skin_color_list(recipient_file)
#run("E:/Python27/ja2donor.png","E:/Python27/ja2recipient.png")
color_table=create_color_table(donor_list,recipient_list)
transplant_skin(recipient_file,color_table)
print "done"
PS I wrote the script on a windows system, so Linux users might want to delete the second line
Also make sure, that your grayscale picture uses about the same brightness as a grayscaled picture of the JA2 character you're using as donor, otherwise the script wont do its job properly.
Oh, and before you guys start complaining about the lack of comments in the code:
Real programmers don't write comments. If it was hard to write, it should be hard to read!
Report message to a moderator
|
Sergeant 1st Class
|
|
|
|
Re: Usermade Faces Data Bank[message #296555]
|
Wed, 11 January 2012 14:06
|
|
Kazuya |
|
Messages:208
Registered:January 2009 |
|
|
Yes, you need to download python, which you can get from python.org
Just check the download section and download the correct installer for your system and install it. Then you need to download the pygame module, which you can get from pygame.org. When you have done that, you start the python idle. Then you select File -> New Windows. In that new window, you paste in the code from my post and save it. Python will ask you for a name. so type in skin_tool.py.
The title of the window should now read: skin_tool.py -
Then you select Run -> Run Module
This should bring back the Python idle to the top. you execute my script by typing:
run(,)
See a screenshot here: http://img141.imageshack.us/img141/358/screen1te.png
There you can also see, what a donor file should look like.
The script will create a test.png file, where you saved the script. The test.png, is the same a s the recipient file, just with the skincolour instead of gray.
[Updated on: Wed, 11 January 2012 14:08] by Moderator Report message to a moderator
|
Sergeant 1st Class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Usermade Faces Data Bank[message #297423]
|
Sun, 29 January 2012 11:02
|
|
Kazuya |
|
Messages:208
Registered:January 2009 |
|
|
Hachiryoku
Any chance you could try at a FOT character for Spider?
What exactly do you mean? Do you want a char that looks similar to spider? Or do you want a char with her coordinates? You can use any of my faces to replace Spider, you just need to adjust the coordinates in the mercprofile, that's why there is a coordinates.txt in all of my releases.
HachiryokuIt's been a while since I played that game. Are you getting the faces from character creation or is it PCs/NPCs from the game?
I ripped all graphics files from Fallout Tactics. I'm using whatever I can, but so far the face pictures have been human RPCs and NPCs. Target is a recruitable character in the BOS Bunkers. The face pictures in game, are grayscale pictures in the format 75x100, which is quite close to the larger animated pictures of NPCs/RPCs in JA2 (90x100). I use those FOT pictures as a template and draw over them. The falloutwiki has all characters listed together with their grayscale picture. Here is Targets page: http://www.falloutwiki.com/Target
If you compare his original picture with my final product, you might not notice right from the start, that it has been changed. First of all his picture is way too bright, but darkening it, won't do the trick, because it will just make his face look flat. I increased contrasts, reduced brightness significantly and put some white with an airbrush back in to give it some depth. I changed the hairline and gave it a little bulge. His eyes in the original picture are quite flat and liveless, so I fixed them as well. There is now a difference between the dark and light parts of the eyes and his pupilles have a shining spot. Next I gave him a nasal bone, which seems to be missing in the original picture. I also changed some other areas slightly, like his moustache and so on. Finally I gave him some shoulders and some clothing, put him in front of an ugly background (taken from a Fallout 3 screenshot), created the different animations scaled the to the proper JA2 formats and called it a day.
Report message to a moderator
|
Sergeant 1st Class
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Usermade Faces Data Bank[message #298522]
|
Sat, 11 February 2012 05:59
|
|
Lejardo |
|
Messages:69
Registered:May 2003 Location: P.R. CHINA |
|
|
Great work!
Thank you very much for sharing this!
I like this very much, but i didn't find the camo version, so i made a full set of camo version: desert, wood, urban.
here is the pic and the file:
And i must say again: thanks for the great pics! it's very beautyful!
http://www.box.com/s/g9efbkjeg96zpc6gfl3h
[Updated on: Sat, 11 February 2012 15:39] by Moderator Report message to a moderator
|
Corporal
|
|
|
|
Re: Usermade Faces Data Bank[message #298587]
|
Sat, 11 February 2012 15:38
|
|
Lejardo |
|
Messages:69
Registered:May 2003 Location: P.R. CHINA |
|
|
OK, spent a whole afternoon, here is all the works.
Some of the portraits are made by my friends Ron in Chinese JA2 forum, it's a pity that he quit making new portraits.
Wish he will be back! Wish new 208,213,218,219 pics!(i've no these pics, so i didn't create full camo version of these 4)
i've packed all these 6 files into 1 7zip,just have a try:
http://www.box.com/s/xkd2tde5403idmqlo8bi
[Updated on: Sat, 11 February 2012 15:41] by Moderator Report message to a moderator
|
Corporal
|
|
|
|
|
|
|
|
|