Author Topic: Color palettes in channel, tilesets, screenshots, etc.  (Read 18360 times)

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Color palettes in channel, tilesets, screenshots, etc.
« on: May 10, 2016, 11:22:09 AM »
Those look great Lamby, very nice.

Thanks mousey :)

Ya unfortunately the game and the battle net client channel screen use different palettes.

I've attached a bitmap of it using the client palette, and ya the greens don't look right.



For anybody interested in making icons but doesn't understand 8-bit palette based graphics, here's a bit of background info.
----------------------------------------------------------------------------------------------------------------------------------
Its like this:

For a given bitmap of this type you get to pick your favorite 256 colors from about 1.6 million.

The picture is then made up of those 256 colors. This selection of colors is the "palette".

In this case you can think of the server channel screen and the in-game screen as two different bitmaps, that have changing pixels.

As we know the game has a lot of green in it: trees, grass, peons, grunts, axers etc. So the game palette has a good variety of greens amoungst the 256 colors in its palette.

The channel screen has a different palette with a more blues, for displaying the channel screen plus ads etc.

-=> History Buffs ...
Yes this is why the swamp tileset is so hideous to look at, because it was added after
the initial release of the game, so the poor guys in the late '90s Blizzard graphic art
department had to come up with a totally new tileset still using the same palette that
was chosen specifically to make grass and snow look good, but somehow make it look
completely different. All they could do was go with that brown and orange 'turd forest'
look, because they were pretty much the only colors left....
...(edit) or was it? always assumed this but it might have its own palette, I must check
If so WTH were you thinking? Yuck!


So if you want to take a picture from a bitmap with one palette and display it using another palette, you have to do color matching. That's where you go through each color in the first palette, then find the color in the second palette that is the closest match, then change all the pixel data to from the first entry to the value of the second entry.

(There's also a process called 'dithering' which blends together colors by speckling little dots of one color on top of a block of another color. It always looks like crap - except in printing where actual ink is used. Fortunately as almost everything graphics-wise is at least 24 bit these days, its rarely seen.)

So in this case we've got pictures from the im-game interface which we want to display as icons in the channel. We have to use the channel palette. So the pics have to be color matched from one palette to the other.

>>> If you want to take graphics from any other source and try to make icons
>>> out of them you will have to color match them to the channel palette.

*Fortunately theres a dead easy way to do this*
-------------------------------------------------------------
Get a SS from the channel. This is an 8-bit palette base pcx file.

Convert it into a .BMP file, but make sure it stays 8-bit and is not converted to 24 or 32 bit. I use "Irfanview" to do this its freeware.... google it if you're not already familiar with it. So just open your SS there and go 'save as'->windows bitmap.

Then open the .BMP in good ol' MS Paint. Then all you have to do is copy / cut the bit of graphics you want to use from wherever (ifranview / another instance of paint / photoshop... etc) and paste it onto the bitmap you have opened in paint.

When you do this paint will automatically pick the best match for each color in the thing you paste from the palette of the open bitmap, which in this case has come from a SS of the channel and is the palette that will ultimately be used to display the icon.

---> This can also no doubt be done in photoshop, probably directly
      in Irfanview and a heap of other ways, but that's how I do it because
      its quick and easy and I've usually already got whatever pic open in
      paint if im messing with it anyway.

For a slightly more technical discussion plus everything you ever wanted to know about screen-shots see my next post.

HF
« Last Edit: September 21, 2016, 10:13:55 PM by Lambchops »
its gooder to hax hard and NEVER get caught!

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #1 on: May 10, 2016, 11:36:13 AM »
SOME NERDY BITS FOR NERDY PEEPS:

(including how to find that SS ur looking for)


An 8 bit(1 byte) number can have values 0-255, so an 8 bit image can have at most 256 different colors. However,  when using a palette each part of the color (red,green,blue... or RGB) has a value between 0 and 255, so there are 256^3 (=16777216) colors to choose from, but only 256 of them can be displayed at any one time.

so :
255,0,0         is bright red  (red=255,green=0,blue=0)
20,0,20         is a darkish purple
255,255,255 is bright white
44,44,44       is a darkish grey
66,66,66       is a lighter grey
0,0,0             is black
etc....

A simplified example of how this type of graphics if stored in a file:

HEADER: "I'm a bitmap, im 8-bit, I'm 640 pixels wide by 480 pixels high and i use 256 different colors" (could be <256 but not usually)

PALETTE: list of 256 x 3bytes :  -->  R,G,B for color 0 --> R,G,B for color 1 --> R,G,B for color 2.... etc. to 255

DATA: 1 byte for each pixel so 640 x 480 =  307,200 bytes*,  - i.e.  color 4, color 162 , color 99 .... or wvr
(*see RLE compression below)

Depending on the file type it will be arranged in slightly different ways: i.e. a BMP is laid out roughly as above, although theres a lot more in the header, which isn't very relevent here, a PNG file has each section compressed using good old PKZip (aka winzip, zlib, 'zip'), PCX is similar to BMP but stores the palette after the pixel data.... and so on.... but regardless of the file, in the end it will be loaded into memory as and array of pixel data  represented by 8-bit indicies into a 256 entry 24 bit color table because that is how that generation of graphics hardware made the pixels on our old CRT monitors light up.

Both BMP and PCX can use a simple form of compression called "run length encoding" or RLE.

RLE simply accounts for long sequences of a single value. For instance if you taks a SS at game start, usually most of your screen will be black, because you havn't scouted anywhere.  In this SS there's maybe half of each pixel line is just a great big line of zeros (pointing to the first palette entry which just happens to be 0,0,0). RLE accounts for this type of thing so instead of actually writing 47 zeros in a row it just makes a little note that says "47 zeros" or "16 '12's" or whatever. The actual way this is written will vary depending on the type of file, however obviously it can be noted using far less than 47 or even 16 bytes (typically 2 or 3).

If it weren't for RLE every SS would be _exactly_ the same size.

<<< HOW TO FIND THAT SS YOU'RE LOOKING FOR >>>

But now we know why they're different sizes you can actually see this by sorting a bunch of SS by size. They end up sorted by the complexity of the image.

Apart from in-game SS, the smallest files are of Human Victory screens because that is the simplest background image, if you look closely at it, you'll see it has not many colors and large blocks of a single color in the clouds and in the castle wall at the lower left. You'll also find that the smallest of these files are from 8 player games, because the stats bars for units, buildings etc. are single blocks of color, so the more players in the game the more stats bars cover the image and the more compressable the image is. The largest of these files will be from 1v1 games.

The Orc defeat screen comes next at the image is a bit more complex, in actual fact you'll probably find 8 player orc defeat screens creeping in around the same size at 6 player human victory screens. It depends on the actual stats of the players and the length of the player names. A little while after this you'll start getting channel screens. Even though there are lots of chunks of black in the text windows, the blue marbled background and bronze edging are actually fairly intricate so these add up to a fair amount of complexity. 

Around the end of your channel screens you'll get your 8 player Orc Victory screens with pre-game lounge screens at around 4 player orc victory size and finally, iroicly the most intricate background is on the Human Defeat screen although mostly because of the massively dithered sky / hills. The end of your 1v1 orc victories will be somewhere around the size of a 4 player human defeat.

Your in-game SS will be scattered throughout. A lot of them will be around the size of the lounge screen, however generally SS from earlier in the game where little scouting has been done especially where black unscouted areas are displayed in the main screen will be smaller. In a large collection of late game SS, those on smaller maps would tend to be statistically smaller than those on 128x128 maps, due to a lower complexity mini-map still being displayed using the same number of screen pixels, however this effect is less important that what is on the main display.

In my current folder the very smallest is from the start of a 2v1 chop game right after I halled, most of the screen and mini-map is black and the file is only 152K. I have a 1v1 Human defeat that is 302K (309,079 bytes) which is larger than the theoretical max size for an uncompressed 640x480 PCX with palette+128byte header which is 308,096 bytes, however there are no uncompressed PCX files and the overhead to support the RLE notation for an image that is not effectively RLE compressable will sometimes actually increase the size of the file as in this case..... yet another reason why dithering is crap.

Another thing you might notice, is that black&white SS from when the game is paused are no smaller that color SS. This might seem strange at first, however there is actually almost no difference between the paused screen/SS and the color one. They are both full 256 color screens, the only difference is that when the game is paused the war2 exe swaps the PALETTE for one that has R,G and B values that are all even for each entry, and therefore all shades of grey. When the game continues the full color palette is replaced, however the pixel data for the display remains unchanged.

But anyway, when you want to find that 1v1 victory screen from last month for bragging rights, sort by size, and - if you were orc, you'll find your 1v1 victories are at the large end of your orc victory screens.

(HINT: They're almost always around the 279KB mark, 1v1 Human wins are about 183KB )

GG
=D

(edit) Supplimental info:

When im talking about "orc defeat" screen, im talking about the one with the picture of an orc on it, which comes up when you are human and lose.... cos the orc is smashing your suff...

...also should mention that there will also be differences in the file size between different tilesets i.e. forest!=winter, although this depends what's on screen at the time.






« Last Edit: November 11, 2016, 11:28:01 PM by Lambchops »
its gooder to hax hard and NEVER get caught!

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #2 on: May 10, 2016, 12:12:53 PM »
and before you ask, for anybody who doesn't know, yes it is very simple to change a black and white paused SS to a color unpaused SS and vice-versa.

Here's a combination of 4 SS. The two at the top are the originals paused and unpaused, the two at the bottom are are the same two SS with the color situation reversed. I didn't include the original files so as not to make it totally obvious for noobs how this is done, but it requires only a relatively minor alteration to the PCX file that would be undetectable by any means I'm aware of. Don't get upset, anyone with the skills to do this already knows how, and now we all know the fact, if not the means.

BTW: these are from a game I was watching where somebody else got asked for a SS - don't worry I'm way too bad a player for anybody to ever bother asking me for one. Just to be PC i removed the names; none of the names visible are the players that asked or got asked.

..and for anybody paying attention to my last post, yes this image displays the colors from 2 different 8-bit palettes so it can't be an 8 bit BMP file (its 24-bit)


« Last Edit: May 10, 2016, 01:01:51 PM by Lambchops »
its gooder to hax hard and NEVER get caught!

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #3 on: May 11, 2016, 11:48:39 AM »
THE LAST WORD ON PALETTES...

So I actually had a look and yes, the forest, winter and wasteland tilesets do indeed have their own individual palettes. More than half of the colors are the same in all, being I guess the colors used for the units, buildings etc. but there's a big chunk of colors thats unique to each tileset. So WHAT ON EARTH WERE YOU THINKING guy who came up with the whole turd forrest look? Were you all doing some really bad acid cut with drain cleaner?.... OK so now I've got that off my chest, the really interesting one is the channel palette. No wonder things dont look as good there : a quater of the colors are all shades of blue AND another quater are all set to that bright lime green that most of the chat text is. As you can see on the attached image, colors 32 thru 95 are all the one color.... the good news is in a future release of w2combat it would be dead simple to add a nice array of other colors to the channel palette that would make any custom icons look much better :D


Anyway here's the extracted palettes from the 3 tilesets and the channel (attached)

 
its gooder to hax hard and NEVER get caught!

Offline EviL~Ryu

  • (ง︡'-'︠)ง "Bitchin!" ®©℗™
  • Dragon
  • **********
  • Posts: 6059
  • "It's going to be Legen-(wait for it......)-DARY!"
    • View Profile
    • Clan EviL Official Page
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #4 on: May 11, 2016, 01:06:43 PM »
Making lamb burgers tonight, yum. [emoji14]


Sent from my Motorola DynaTAC 8000X using Tapatalk

-Administrator of Clan EviL
-Developer (Trivia Development and Analytics)

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #5 on: May 11, 2016, 01:40:32 PM »
Making lamb burgers tonight, yum.
:O
its gooder to hax hard and NEVER get caught!

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #6 on: May 11, 2016, 01:41:02 PM »
its gooder to hax hard and NEVER get caught!

Offline EviL~Ryu

  • (ง︡'-'︠)ง "Bitchin!" ®©℗™
  • Dragon
  • **********
  • Posts: 6059
  • "It's going to be Legen-(wait for it......)-DARY!"
    • View Profile
    • Clan EviL Official Page
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #7 on: May 11, 2016, 06:42:10 PM »
Making lamb burgers tonight, yum.
:O


From New Zealand [emoji39][emoji491][emoji491]

-Administrator of Clan EviL
-Developer (Trivia Development and Analytics)

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #8 on: May 20, 2016, 01:14:12 AM »
Making lamb burgers tonight, yum.

From New Zealand [emoji39][emoji491][emoji491]

Excellent choice, I hear the kiwis breed very tasty lamb, much better than Australian lamb which I'm told is terrible (and noobish)   ;)
its gooder to hax hard and NEVER get caught!

Offline EviL~Ryu

  • (ง︡'-'︠)ง "Bitchin!" ®©℗™
  • Dragon
  • **********
  • Posts: 6059
  • "It's going to be Legen-(wait for it......)-DARY!"
    • View Profile
    • Clan EviL Official Page
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #9 on: May 20, 2016, 01:16:04 AM »
Making lamb burgers tonight, yum.

From New Zealand [emoji39][emoji491][emoji491]

Excellent choice, I hear the kiwis breed very tasty lamb, much better than Australian lamb which I'm told is terrible (and noobish)   ;)


Yep! I am glad you know your meats. [emoji846] Many don't [emoji58] Some here are vegans [emoji43]

-Administrator of Clan EviL
-Developer (Trivia Development and Analytics)

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #10 on: May 20, 2016, 01:36:57 AM »
Oh here's the original button tile graphics. If anybody needs them. Pretty sure I pulled them from a memory resident mpq, but it was a while ago.

There's a few extras that never made it into the game. Check out the horses and wargs. I thought maybe there was and idea in the original design to produce horses then put a footie on them to make a knight or somesuch, but their position in the order of tiles suggests these were upgrades, like ranger/beserker upgrades only for knights and warg-riders? ?

Not sure what to make of the little spell icons that come straight after the orc shield upgrades, perhaps they were and original design for the little on screen unit spell markers, like the little blood droplet for lusties.


its gooder to hax hard and NEVER get caught!

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
Re: Re: Awarding custom client tags as a prize for your tourney
« Reply #11 on: May 20, 2016, 03:06:28 AM »
Oh here's the original button tile graphics. If anybody needs them. Pretty sure I pulled them from a memory resident mpq, but it was a while ago.

There's a few extras that never made it into the game. Check out the horses and wargs. I thought maybe there was and idea in the original design to produce horses then put a footie on them to make a knight or somesuch, but their position in the order of tiles suggests these were upgrades, like ranger/beserker upgrades only for knights and warg-riders? ?

Not sure what to make of the little spell icons that come straight after the orc shield upgrades, perhaps they were and original design for the little on screen unit spell markers, like the little blood droplet for lusties.




Yes I found these also awhile ago. I assume the smalls ones are for the cleric upgrade that whole unit still has a grp file, plus if you edit the tbl files you can see the cost and names for the upgrades, etc. ;)

Edit copy your info for the palettes and icons post in the welcome thread in the mods section. Also use a spoiler to hide all that info. Thanks man!
« Last Edit: May 20, 2016, 03:17:16 AM by tupac »

Offline mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 2065
    • View Profile
    • War2.me
Re: Color palettes in channel, tilesets, screenshots, etc.
« Reply #12 on: May 28, 2016, 03:01:18 PM »
Why is there a gigantic gob of the same shade of green in the channel palette lamby? It seems like such a waste. Is this something that could be changed?

squeak!

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: Color palettes in channel, tilesets, screenshots, etc.
« Reply #13 on: May 29, 2016, 12:06:26 AM »
nice work...i was in 24 bit bmp maybe why i couldnt get the .pal...u into making grps? u seem very keen in the paint stuff.

Offline Lambchops

  • Ogre Mage
  • ********
  • Posts: 1541
    • View Profile
Re: Color palettes in channel, tilesets, screenshots, etc.
« Reply #14 on: June 03, 2016, 10:49:57 PM »
Why is there a gigantic gob of the same shade of green in the channel palette lamby? It seems like such a waste. Is this something that could be changed?

Hehe. Very easily apparantly. I was just going to write my theory about how it might be space for custom colors for the banner ads, but I just looked....

Yep sure is. No surprise to at least one person around here lol. Presumably the bnet client part was made to download the palette entries with the banner ads when you log on... or maybe theres a few built in palettes to choose from idk.

I took that palette from an old SS that's just got the big blue and gold "WELCOME TO BATTLE.NET" baner, however with the current 'summer festival' there's a bunch of new entries there. Cool :)

So, we should ask whoever puts the ads on the server how it works ... blid i spose

and I got to say, having a summer festival now is pretty silly cos June is in winter...  ;)

its gooder to hax hard and NEVER get caught!