Messed up skins: what happened?

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Messed up skins: what happened?

Post by Spike »

gamma 1; contrast 1
colours should then match (except for light levels, anyway, so it won't be an exact match anyway).

A few people now have mentioned that you should be able to copy (via windows clipboard) your edited images into a file with the right palette, then save that with the right name. This should then use the data from the clipboard with the palette of the file you inserted the image into. I can't guarentee that of course, as I don't personally use any of these tools other than just to view stuff. Still, its a nice theory, and nice theorys are nice.
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Re: Messed up skins: what happened?

Post by goldenboy »

Onemanclan, you can simply use GIMP to import the palette from any indexed image. This is what I meant when I said "please learn Photoshop or GIMP" in the other thread. :wink: If you need help with Photoshop or GIMP or Blender, it makes a lot more sense to ask people at the Photoshop / GIMP / Blender forums because chances are they will know what they are doing.

You can then use your imported palette when converting any image back to indexed.

1) Please open the Quake player model (or any Quake model) in QME. Right click on "skin0" and choose "Export". Save the skin as a BMP image.

2) Please open GIMP and load the BMP image you just created.

2a) In GIMP, open the palettes dialog; it's the one that has a lot of pre-made palettes in a list. Right click anywhere in it and from the popup menu, chose "Import palette".

Image

2b) The import palette dialog will open; under "Select source" select the radio button labeled "Image". This dialog should then already display the correct palette (the Quake palette in this case) in its preview window, as it does here:

Image

Click "Import". This will save the palette from the image into GIMP.

2c) When you convert any RGB image to indexed (palettize it), the dialog will ask you what palette to use. Click "Use custom palette". Select your previously saved Quake palette.

Image

You can then save your skin as a PCX image because that's the indexed format that Quake originally used.

After you convert an RGB image to indexed, we're no longer talking about a high-res skin, of course.
Last edited by goldenboy on Sat Mar 02, 2013 3:43 pm, edited 1 time in total.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Messed up skins: what happened?

Post by Spike »

@gb: export LANG= && gimp
might have helped, in case there are version/os differences. :P
but yeah, comprehension is easier when its in 'your' own language. :s
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Re: Messed up skins: what happened?

Post by goldenboy »

The difference between "convert" and "konverter" isn't earth shattering. I thought it would be clear from the images as well - the dialogues should look exactly the same in the English version. :mrgreen:
OneManClan
Posts: 247
Joined: Sat Feb 28, 2009 2:38 pm
Contact:

Re: Messed up skins: what happened?

Post by OneManClan »

Hey gb, thanks for the awesome info, and screenshots(!)
goldenboy wrote:
I thought the reason for my messed up skins dramas was because Quakeshop's conversion from pcx->RGB "changes something" ( 'corrupts the Quake palette numbering system' ?) and no matter what I've tried ( using different quake palettes when converting back to indexed color, importing the psd in Paint Shop pro (and GIMP, and outputting a pcx, etc etc) all I get is messed up colors.
GIMP will in any case not "change something" when converting an indexed image to RGB.
Cool. I'm still confused as to why I can't 'convert' these RGB images (which use ONLY colours I picked from other quake images with the eye dropper) to be Quake compatible. If I don't figure it out, I'll have to (sadly) begin drawing everything again using GIMP, just need to confirm first that "there is no other way". Whilst rftming, I regularly come across people 'converting' things to the Quake pallette eg the Nominion Squid, where DrDire says shows the squid (presumably not Quake compatible, and then says "here it is with the quake palette". Why can't I take my skins and make them "Quake compatible"?

goldenboy wrote:Also, apparently you want to create low-res textures (ie indexed) - this got me a little confused because you mentioned high res textures.
Well the initial problem was the "messed up skins", but in trying to resolve it, I realised:

a> I was just guessing, and had no idea how the pros do it, so why (clumsily) reinvent the wheel (especially when ive already hit a stumbling block)
b> I saw that high resolution head on the ground, and wondered "if skins HAVE to look 'rough and low res' because of quake 'limited palette', then how can that face look so sharp and detailed? [EDIT: it's because I was using fte, which can display images from mdls with skins which are higher res, and can bypass the Quake palette limitations. The high-res-head in question is not displayed in EZquake]

So I split the question into two threads 'please help me fix my skins, and 'how do the pros make these high res textures'

If there's a way to make skins which look as high res as the headless mdl, then that clearly would be the way to go, especially as everything looks so sharp in FTE, except for the skins, which look fuzzy and lo-res.
goldenboy wrote: What I told you above regards the creation of high resolution RGB textures, not indexed textures. Still, even if you want to convert your skin to indexed eventually, you do not need to use only colours from your target palette during painting. The conversion will take care of the colours.

I described in your other thread (http://forums.inside3d.com/viewtopic.ph ... c30#p48657 how you can import the palette from an indexed image with GIMP, and how you can convert an RGB image to indexed using that same palette. This process works just fine for me.
Don't import the PSD into GIMP, export a BMP from PS and load that into GIMP to bypass any potential issues with GIMP and PSD format.

Well I've tried this over and over and over with every setting I can find, and the least 'messed up' skins were done with the following procedure (sorry for the perhaps gratuitous detail, but I'm worried that there's something really dumb I've missed):

Firstly here's what the skin SHOULD look like:
http://www.flickr.com/photos/60268498@N ... hotostream


1. Open the psd in Photoshop
2. Save as BMP, Windows, 16 bit (tried 24 bit)
3. Open BMP in GIMP
4. Image->Mode->indexed
5. At 'Indexed Color conversion' dialogue box, select custom, and select the palette I made earlier (as per your instructions)
6. Untick 'Remove unused colors from colormap'
7. Click 'convert'. Note: the image still looks good /normal at this stage.
8. File->export. Then select Zsoft PCX Image.


This produced a skin which looked ok, still messed up, but 'getting there'. Here's the Blue version:
http://www.flickr.com/photos/60268498@N ... hotostream

And here's the Red version:
http://www.flickr.com/photos/60268498@N ... otostream/

The (red) blood looks ok, the vomit (which is supposed to be green) has become white, I think the yellow on the face has somehow become a 'team color'. Btw the red spots on the body are normal (meant to be diseased open sores), and the 'D' on the chest was my ID/marker, way of ensuring that the client was indeed loading up the right model. Not sure where to go from here.
goldenboy wrote: So your issue is that the conversion to indexed mode *slightly* changes the colours of your image?
No, it's the messed up skins, as per my screenshots.
goldenboy wrote: I'm not sure any of this fixes the issue with the really screwed colours you seem to have after exporting. Pretty sure that's a result of using the wrong palette when indexing (or an engine bug; double check your skins in a known good engine such as DP).

Edit: The best and simplest fix for all your problems is not to use indexed images. Why can't you just use JPG or TGA format for your skins?
[/quote]

I only used indexed images because that's what the original skin exported as (from QME). I dont understand if Ive been so careful to keep the original format and only use colours Ive copied from existing valid working quake skins, then why are my skins so 'unsalvagable'?

There seem to be two bits of (to my newbie understanding) contradictory information:

1. If you convert a valid Quake skin to the wrong format (eg Photoshops RGB) you mess up the 'indexing' of the image's palette, and the image becomes non-Quake compatible, permanently.
2. You can make a skin/texture in any format, and then later 'convert it' to use the quake palette.
:?

Thanks again for the screenshots, much appreciated! :)
Last edited by OneManClan on Fri Mar 08, 2013 2:07 am, edited 1 time in total.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Messed up skins: what happened?

Post by Spike »

If there's a way to make skins which look as high res as the headless mdl, then that clearly would be the way to go, especially as everything looks so sharp in FTE, except for the skins, which look fuzzy and lo-res.
http://triptohell.info/moodles/junk/highres.zip
try that skin. extract into your quake/qw/ directory, retaining paths. use the "skin highres" console command. you can figure out the rest for yourself.
note that I didn't make it, I've only renamed the files to match quakeworld player skins instead of being an nq-style skin.

I have no idea how much work it will take for you to update your existing skins to match, but beware that ezquake does not support this sort of replacement skin.
OneManClan
Posts: 247
Joined: Sat Feb 28, 2009 2:38 pm
Contact:

Re: Messed up skins: what happened?

Post by OneManClan »

Update:

Work on what I've dubbed the 'DoomFace' mod has ground to a halt, as my mind struggles with the boggling complexity of how different Quake clients + mdls + skins + image formats + palettes all actually interract. To that end, I've been doing some experiments, and I thought I'd share the latest results:

First, here's our new buddy, MrPalette:
Image

FTE: looking at a Blue Team MrPalette
Image

FTE: looking at a Red Team MrPalette
Image

DP (a 2009 version): looking at a Red Team MrPalette
Image

EZquake: looking at a Red Team MrPalette
Image
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Messed up skins: what happened?

Post by Spike »

#define TOP_DEFAULT 1
#define BOTTOM_DEFAULT 6

these ranges are 0-based (its only 1-based if there's a 'th' on the end - english makes things inconsistant!).
so the second row (one of the browns) is swapped with the topcolor row (so 1->4 for red team, and 1->13 for blue).
and the 7th row (that orange->yellow range) is swapped with the bottomcolor row (so 6->4 for red team, and 6->13 for blue).

the face mask thing looks to me to be the bright yellow from range 6 and is thus subject to the player's bottomcolor setting.
so when fte and ezquake both show blue or red (correctly for the team) instead of that yellow its hardly surprising.

The only inconsistancy here is that your DP build doesn't appear to be doing any colormapping at all, hence why DP's legs are using a colour from the middle of range 6 instead of being red or blue - the trouser colour in your pcx skin image.

So yeah, you need to avoid using the 2nd row, the 7th row, and the last two rows or you'll get colours changing to match teams or fullbright pixels.

Does that help clarify anything?
OneManClan
Posts: 247
Joined: Sat Feb 28, 2009 2:38 pm
Contact:

Re: Messed up skins: what happened?

Post by OneManClan »

Spike wrote: the face mask thing looks to me to be the bright yellow from range 6 and is thus subject to the player's bottomcolor setting.
so when fte and ezquake both show blue or red (correctly for the team) instead of that yellow its hardly surprising.
The yellow was taken from the 13th row, you can actually see (above) in the EZquake shot of MrPalette, that the furthermost yellow is .. red. If the problem is the colours, I might have a go at substituting it to a darker yellow (all other yellows looked good) in Photoshop.
Spike wrote: The only inconsistancy here is that your DP build doesn't appear to be doing any colormapping at all, hence why DP's legs are using a colour from the middle of range 6 instead of being red or blue - the trouser colour in your pcx skin image.
Yea, weird.
Spike wrote: So yeah, you need to avoid using the 2nd row, the 7th row, and the last two rows or you'll get colours changing to match teams or fullbright pixels.

Does that help clarify anything?
Yes it does, thanks. I know the last row is supposed to be fullbright, but from what I can tell, players are always bright in TF
Image
Last edited by OneManClan on Fri Apr 19, 2013 10:01 pm, edited 1 time in total.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: Messed up skins: what happened?

Post by frag.machine »

OneManClan, be aware that even if you correctly picked a color from the Quake indexed palette, sometimes a tool in the painting program you're using may replace it by another color index, in the same palette. At least with older versions of Paint Shop Pro this happened to me more than once: I painted some skin area with the an indexed color (say, index 0) and later, when using the color replacer tool, the program silently replaced it with another color index that closely matched the RGB values (but using a completely different color index).

That's the workflow I would use on this case:

a) create your skin using your preffered painting tool (Photoshop, PSP, GIMP, whatever). Don't worry about pants or shirts colors correctness at this stage: just focus on producing your 24-bpp texture;
b) save it in a engine-friendly format (TGA or PNG, I would advise against JPEG because they may look really bad on alias models);
c) from this TGA/PNG colormap texture, create shirt and pants versions (basically removing the undesired parts and using grayscale to the visible parts), again saving in a engine-friendly format (pay attention to the naming and folder conventions each engine uses). Now you have your high resolution skin with shirt and pants support in FTE/DP/etc, and if you don't care about engines that don't support external textures you're done;
d) go back to your first texture, scale down the color applying the Quake pallete to it;
e) knowing which color indexes represent the pants and shirt colors in the pallete, use them where appropriated;
f) save the resulting texture in a pallete indexed format (256 color BMP or PCX), so you won't incur in accidental color mismatch;
g) use the resulting image with your favorite utility to add/replace skins in the model. Bang, now besides the 24-bit resolution texture you have the lower version showing correctly, too. Of course, you won't be able it to look as good, but careful pixel drawing and hand-made dithering can bring surprising results.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
ceriux
Posts: 2230
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Re: Messed up skins: what happened?

Post by ceriux »

iv never had a problem with the palette when using photoshop. i usually just paint my texture. then index the colors by selecting an external palette.
OneManClan
Posts: 247
Joined: Sat Feb 28, 2009 2:38 pm
Contact:

Re: Messed up skins: what happened?

Post by OneManClan »

ceriux wrote:iv never had a problem with the palette when using photoshop. i usually just paint my texture. then index the colors by selecting an external palette.
Well... (yes this is an admission of defeat!) could you please please have a go at seeing if you can possibly make this apparently incompatible skin Quake compatible?? It was made using the procedure described in my original post.

I'm slowly getting a grip of colormap inconsistencies (as seen in the 'MrPalette' tests above), but the completely 'messed up skins' AFTER my "palette conversion" attempt is still a mystery.

*fingers crossed*

:|
OneManClan
Posts: 247
Joined: Sat Feb 28, 2009 2:38 pm
Contact:

Re: Messed up skins: what happened?

Post by OneManClan »

Hey Frag.machine.
frag.machine wrote:OneManClan, be aware that even if you correctly picked a color from the Quake indexed palette, sometimes a tool in the painting program you're using may replace it by another color index, in the same palette.
Jeez :shock:
frag.machine wrote:At least with older versions of Paint Shop Pro this happened to me more than once: I painted some skin area with the an indexed color (say, index 0) and later, when using the color replacer tool, the program silently replaced it with another color index that closely matched the RGB values (but using a completely different color index).
Ok so it's NOT a simple matter of 'use older software'? *sigh* Man, did those 14 year old boys in the 90s really have to navigate these obstacles to make their Quake skins? Anyway:
frag.machine wrote:That's the workflow I would use on this case:

a) create your skin using your preffered painting tool (Photoshop, PSP, GIMP, whatever). Don't worry about pants or shirts colors correctness at this stage: just focus on producing your 24-bpp texture;
b) save it in a engine-friendly format (TGA or PNG, I would advise against JPEG because they may look really bad on alias models);
Ok the phrasing of the following step confused me.
frag.machine wrote:c) from this TGA/PNG colormap texture,
I'm not sure if you're using 'colormap' and 'texture' as verbs or nouns.. or by 'texture' do you mean 'the skin'?
frag.machine wrote: create shirt and pants versions (basically removing the undesired parts and using grayscale to the visible parts),
:? Use eraser tool to remove the shirt and pants(?), and then.. 'using grayscale'? I don't follow. Bear in mind that I've drawn blood and goo running down a players chest 'over' the (team coloured) bits, though I'm not sure we're talking about the same thing.
frag.machine wrote:again saving in a engine-friendly format (pay attention to the naming and folder conventions each engine uses). Now you have your high resolution skin with shirt and pants support in FTE/DP/etc, and if you don't care about engines that don't support external textures [OMC: ie EZquake] you're done;
frag.machine wrote:d) go back to your first texture, scale down the color applying the Quake pallete to it;
I assume there isn't a 'scale down the color' stage before applying 'the Quake palette to it' Sorry for being pedantic, but please confirm, you mean 'apply the Quake palette, which will scale down the color'?
frag.machine wrote:e) knowing which color indexes represent the pants and shirt colors in the pallete, use them where appropriated;
f) save the resulting texture in a pallete indexed format (256 color BMP or PCX), so you won't incur in accidental color mismatch;
g) use the resulting image with your favorite utility to add/replace skins in the model.
Ok g) confused me. The 'resulting image' is the skin itself, yea? How do you mean use [my new skin] with my favourite 'utility' to 'add/replace' skins in the model itself? [EDIT: Oh, I get it, you mean to use QME (or whatever) to put the skin on the model. This mod 'Doomface' involves changing skins dynamically on the same model, ie these are all player skins, and will be changed multiple times (as required) during gameplay. An earlier prototype stored all the skins in the mdl, but Ezquake can't load models with over 100 skins]
frag.machine wrote:Bang, now besides the 24-bit resolution texture you have the lower version showing correctly, too. Of course, you won't be able it to look as good, but careful pixel drawing and hand-made dithering can bring surprising results.
Thanks FM. I'll wait another day (with bated breath!) to see if Ceriux (or someone else) can see if THEY can salvage a non-messed-up version of my example skin.
OneManClan
Posts: 247
Joined: Sat Feb 28, 2009 2:38 pm
Contact:

Re: Messed up skins: what happened?

Post by OneManClan »

If I may segue at this point to go over my current 'understanding' of this whole Quake Graphics issue. Please confirm, correct, lol, deny or nitpick the truth (or otherwise) of the following basic concepts /descriptions.

[DISCLAIMER: This list possibly (probably?) contains FACTUAL ERRORS! Any newbies reading this in future please read the responses that follow for corrections]
KNOWLEDGE CHECK: QUAKE SKINS FUNDAMENTALS

1. All 'bitmapped' computer images (ie as opposed to vector graphics) could be considered a '2D matrix of pixels'.

2. When 'saving' an image file, you are not saving the colours, you are in fact saving a 2D matrix of numbers, where each number refers to a colour.

3. The 'colour' that the number refers to can be different based on the renderer, the 'bit of software that does the displaying of the image' (whether it be the picture editing program, a monitor driver, or ... a Quake client)

4. A 'indexed palette' is an array of paired values where numbers are 'mapped' to specific colors. RGB is a different system where (IIUC) every 'cell' in the 2d matrix stores three numbers, the red, green and blue amounts.

5. When you open an image, the renderer reads each number in every element of the matrix, and matches every number to a colour, it then displays that colour in the pixel.

6. The 'Quake palette' is an array of 255 structures, containing pairs of values, which map specific numbers in the image file, to specific colours the original Quake could display (note the past tense(!), this is where I got confused!!)

7. THIS IS PURE GUESSWORK: The variables which store the 'pairs of values' are a set size, and if your image has a pixel/cell which contains a numeric value higher than the Quake Palette variable can store/ is expecting, it moves pointer to the next element to an 'invalid position', and this messes up/corrupts the entire 'read' of the array. This is the only reason I can imagine that one 'bad' (presumably too large) value results in the whole skin being messed up (???)

8. Skins originally HAD to use the Quake palette, because of hardware limitations in the mid 90's, and the consequent requirement to use software mode(?), HOWEVER:

9. Clients such as FTE / DP have been modified so they can load TGA or PNG formatted skins and 'bypass' the 255 limit. The 'high res head' model contains such a skin - but it cannot be viewed by EZquake, because:

10. EZquake has NOT been modified and thus IS still limited to only displaying pcx (and png?) skins with the Quake palette, as per the original Quake.

....... Hopefully the above is basically correct.

Now, the next bit I'm still fuzzy about:

11. EZquake can use a different system of skins (?) where multiple skins are placed on top of the same model (presumably via making some colours transparent?) and somehow this can be used with team colours? I'm still trying to understand this, and looking over my notes from Spike (thanks again Spike!). I notice there are bunch of mono coloured skins in my qw folder, green, cyan, red, blue, white.. Still trying to figure out what they do/how they work, and/or if they are in fact relevant.

.. how did I do? :|
Last edited by OneManClan on Sat Mar 09, 2013 4:40 am, edited 1 time in total.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Messed up skins: what happened?

Post by Spike »

ezquake supports 24bit skins, but not colormapped 24bit skins.
that means you can load up a png just fine, but you can't figure out which team that player is on.
you can work around that by creating two copies of the skin, one for red team one for blue team.
you probably won't want to bother with shirt colours though.

the multiple skins added together thing is specific to fte and dp.
the shirt/trouser images are recoloured to match the player's settings, then added together onto a presumably black area of the base skin. so you basically make your skin as normal, with the player colours drawn in white. then cut those bits out and paste them into another two images in the same locations leaving only black behind.
then the engine draws basetexture+(shirtcolor*shirttexture)+(pantscolor*pantstexture) and you get team-coloured high-res skins that naturally respond to both colour settings.

fun feature of the day: 'color 0x00ff00' in fte will make your player colours bright green.
Post Reply