Difference between revisions of "Colour map"

From Worms Knowledge Base

Jump to: navigation, search
(Map size)
(Map size)
Line 19: Line 19:
 
Here is the list of all possible maps size having the same width/height ratio (1920/696 = 80/29) and valid (both width and height can be divided by 8) I figured that it might help some people...
 
Here is the list of all possible maps size having the same width/height ratio (1920/696 = 80/29) and valid (both width and height can be divided by 8) I figured that it might help some people...
 
(can someone edit this so we have to click to show the list, i don't know how to do that)
 
(can someone edit this so we have to click to show the list, i don't know how to do that)
640 x 232
+
 
1280 x 464
+
{| border="1"
1920 x 696
+
!Width
2560 x 928
+
!Height
3200 x 1160
+
|-
3840 x 1392
+
|640
4480 x 1624
+
|232
5120 x 1856
+
|-
5760 x 2088
+
|1280
6400 x 2320
+
|464
7040 x 2552
+
|-
7680 x 2784
+
|1920
8320 x 3016
+
|696
8960 x 3248
+
|-
9600 x 3480
+
|2560
10240 x 3712
+
|928
10880 x 3944
+
|-
11520 x 4176
+
|3200
12160 x 4408
+
|1160
12800 x 4640
+
|-
13440 x 4872
+
|3840
14080 x 5104
+
|1392
14720 x 5336
+
|-
15360 x 5568
+
|4480
16000 x 5800
+
|1624
16640 x 6032
+
|-
17280 x 6264
+
|5120
17920 x 6496
+
|1856
18560 x 6728
+
|-
19200 x 6960
+
|5760
19840 x 7192
+
|2088
20480 x 7424
+
|-
21120 x 7656
+
|6400
21760 x 7888
+
|2320
22400 x 8120
+
|-
23040 x 8352
+
|7040
23680 x 8584
+
|2552
24320 x 8816
+
|-
24960 x 9048
+
|7680
25600 x 9280
+
|2784
26240 x 9512
+
|-
26880 x 9744
+
|8320
27520 x 9976
+
|3016
28160 x 10208
+
|-
28800 x 10440
+
|8960
29440 x 10672
+
|3248
30080 x 10904
+
|-
30720 x 11136
+
|9600
31360 x 11368
+
|3480
32000 x 11600
+
|-
 +
|10240
 +
|3712
 +
|-
 +
|10880
 +
|3944
 +
|-
 +
|11520
 +
|4176
 +
|-
 +
|12160
 +
|4408
 +
|-
 +
|12800
 +
|4640
 +
|-
 +
|13440
 +
|4872
 +
|-
 +
|14080
 +
|5104
 +
|-
 +
|14720
 +
|5336
 +
|-
 +
|15360
 +
|5568
 +
|-
 +
|16000
 +
|5800
 +
|-
 +
|16640
 +
|6032
 +
|-
 +
|17280
 +
|6264
 +
|-
 +
|17920
 +
|6496
 +
|-
 +
|18560
 +
|6728
 +
|-
 +
|19200
 +
|6960
 +
|-
 +
|19840
 +
|7192
 +
|-
 +
|20480
 +
|7424
 +
|-
 +
|21120
 +
|7656
 +
|-
 +
|21760
 +
|7888
 +
|-
 +
|22400
 +
|8120
 +
|-
 +
|23040
 +
|8352
 +
|-
 +
|23680
 +
|8584
 +
|-
 +
|24320
 +
|8816
 +
|-
 +
|24960
 +
|9048
 +
|-
 +
|25600
 +
|9280
 +
|-
 +
|26240
 +
|9512
 +
|-
 +
|26880
 +
|9744
 +
|-
 +
|27520
 +
|9976
 +
|-
 +
|28160
 +
|10208
 +
|-
 +
|28800
 +
|10440
 +
|-
 +
|29440
 +
|10672
 +
|-
 +
|30080
 +
|10904
 +
|-
 +
|30720
 +
|11136
 +
|-
 +
|31360
 +
|11368
 +
|-
 +
|32000
 +
|11600
 +
|}
  
 
== Colour limitation ==
 
== Colour limitation ==

Revision as of 14:00, 9 December 2007

(Up to File formats)

Support for PNG colour maps were added to Worms Armageddon with the v3.6.19.7 Beta Update (released on 9 February 2004). W:A maps need to be in a paletted 256-colour mode. The number of colours that may appear in the map is restricted as well. W:A stores the extra map settings (water level, borders, etc.) in an extra PNG chunk.

The black colour, which must be present in the colour palette, is considered as transparent (zones/pixels painted black will appear as free space in the game).

Map size

Versions of W:A before 3.6.27.4 only allowed maps that are exactly 1920×696 pixels in size. Version 3.6.27.4 introduces support for arbitrarily-sized maps, with the following restrictions:

  • the width and height of a map must be divisible by 8;
  • a cavern map may now be up to 32512 pixels wide and 32600 pixels tall;
  • an island is limited to being 28416 pixels wide and 30552 pixels tall;
  • the minimum map size is 640×32 pixels.

Here is the list of all possible maps size having the same width/height ratio (1920/696 = 80/29) and valid (both width and height can be divided by 8) I figured that it might help some people... (can someone edit this so we have to click to show the list, i don't know how to do that)

Width Height
640 232
1280 464
1920 696
2560 928
3200 1160
3840 1392
4480 1624
5120 1856
5760 2088
6400 2320
7040 2552
7680 2784
8320 3016
8960 3248
9600 3480
10240 3712
10880 3944
11520 4176
12160 4408
12800 4640
13440 4872
14080 5104
14720 5336
15360 5568
16000 5800
16640 6032
17280 6264
17920 6496
18560 6728
19200 6960
19840 7192
20480 7424
21120 7656
21760 7888
22400 8120
23040 8352
23680 8584
24320 8816
24960 9048
25600 9280
26240 9512
26880 9744
27520 9976
28160 10208
28800 10440
29440 10672
30080 10904
30720 11136
31360 11368
32000 11600

Colour limitation

Since W:A uses a paletted display, the number of colours that may appear simultaneously on-screen is limited. The majority of the colour space is used for in-game graphics for the Worms, weapons, objects, water, UI elements, etc. Therefore, the colour maps may only use a limited number of colours in the palette (excluding black, which is treated as transparent), without affecting other Worms graphics:

  • 64 colours and less - the map will be displayed perfectly, with no glitches
  • 65-96 colours - the map background sprites (falling debris, clouds, etc.) are removed; the destroyed-soil background may be glitchy
  • 97-112 colours - destroyed soil will be solid black; the destroyed-soil border is solid gray. The background gradient palette will be evenly loaded into the remaining space in the palette, and the background gradient is redithered using the map + background palette - thus, a map with 112 colours (bar black) will have a background gradient dithered exclusively from the map's palette.
  • 113 colours and more - the map will not load.

These restrictions apply to the palette size, not merely the number of unique colours. WA will automatically reduce the palette losslessly, or offer to dither the image. Internally WA only supports a palette of 113 colours or less and requires that the colour at palette position 0 is black.

PNG chunk

W:A stores the extra settings in an extra PNG chunk, labeled w2lv or waLV. The chunk, excluding the label header, is at least 40 bytes long, and contains the same data as the header for monochrome maps. Extensions to the header format add extra bytes at the end; so far, there is one optional extra byte which controls the number of worm/object placement holes (the default is 18).

TweakPNG allows manipulation of PNG images on the chunk level, thus allowing chunk import/export, etc.

Authoring instructions

Microsoft Paint

Microsoft Paint will always save paletted PNGs with 256 colours in the palette, even if not all colours are used in the image. This makes it hard to create new maps with Microsoft Paint - however, if you would like to use just freeware products, this limitation can be overcomed using TweakPNG:

  • You may edit an already existing map. This will not allow you to edit the palette with Microsoft Paint, however you can use TweakPNG to do that.
  • You may create a new map in MS Paint as usual, and later reduce the number of colours in the palette using TweakPNG. You must however be careful to only use the colours at the beginning of the colour palette, otherwise your map will not load or will lose colour information.
  • Before drawing your new map, you may create your colour palette beforehand. To do that, create a new 256-colour PNG (see below), and then edit the palette chunk using TweakPNG, and resize the palette to at most 113 colours. You can also edit the palette colours from TweakPNG. After you're done, save the image and open it with Paint - Paint will now use the palette specified by you.

To create a 256-colour PNG in MS Paint:

  1. open or draw your map, or open a new image
  2. click File, Save As...
  3. in the Save as type drop-down box, select 256 Color Bitmap
  4. enter a temporary file name and click Save
  5. when prompted about loss of colour information, click Yes. This will downsample your current image to use a standard 256-colour palette.
  6. click File, Save As...
  7. in the Save as type drop-down box, select PNG
  8. enter the name of your 256-colour .PNG image and click Save.

After you're done, you may delete the temporary BMP file created in step 4. The saved PNG will have 256 colours in the palette - see above on how to reduce the number of colours with TweakPNG.

Adobe Photoshop

Use the following steps to create a WA-compatible map in Adobe Photoshop:

  1. draw or open your map
  2. select File -> Save for Web (or Save for Web & Devices in CS3)
  3. in the options in the right, set the following options:
    • set Optimized file format to PNG-8
    • uncheck Transparency and Interlaced (if any was checked)
    • set Maximum number of colors in Color Table to 113 or below (see above for details on side effects of using certain colour ranges)
    • play with the Color reduction algorithm and Dither algorithm options until your map looks nice, increase/decrease the number of colours accordingly
    • if there is no black in the colour palette (e.g. Mole Shopper maps), you'll have to add it manually: set Colour reduction algorithm to Custom, choose the black colour using the controls to the left, and click the Add color (Adds eyedropper color to palette) button
  4. click Save, enter a file name.

Paint Shop Pro

Use the following steps to create a WA-compatible map in Paint Shop Pro:

  1. draw or open your map
  2. select Image -> Decrease Color Depth -> X Colors (4/8 bit)
    • set Number of colors to 113 or below (see above for details on side effects of using certain colour ranges)
    • it is recommended that you select Optimized Median Cut from the Palette options and Nearest color from the Reduction method options
  3. select File -> Save As
    • enter a file name
    • select Portable Network Graphics (*.png)
    • click Save

The GIMP

The GIMP (GNU Image Manipulation Program) is a free advanced image editor. Here's how to author your W:A-compatible maps using The GIMP:

  1. draw or open your map
  2. select Image -> Mode -> Indexed...
  3. select the desired colour-reducing image options.
    • Normally you'll want to generate an optimum colour palette and use some kind of dithering (you don't need transparency dithering as W:A doesn't understand PNG transparency).
    • Maximum number of colors should be set to 113 or below (see above for details on side effects of using certain colour ranges). It must also be a number above 16, otherwise The GIMP will save your PNG as a 4-bit or 1-bit image, instead of an 8-bit image required by W:A.
  4. when creating a reduced colour palette, GIMP sometimes doesn't create a "pure black" palette entry. To check and fix this, do the following:
    1. open the Colormap by selecting Dialogs -> Colormap
    2. find the black colour index (it's usually first)
      • Hint: you can find the colour index of a pixel in the image by selecting the Color Picker tool, and clicking in the transparent/black area. The Index field will show the clicked colour's index.
    3. double-click the black colour entry to open the Edit Colormap Entry dialog
    4. set the R, G and B values to 0.
  5. select File -> Save as...
  6. enter a file name - the file name must include the extension and end with .png
  7. click Save to open the Save as PNG dialog:
    • uncheck Interlacing as it will only increase your image's file size.
    • you may uncheck all Save ... options, as W:A ignores them
    • compression level can be set to maximum (PNG is a lossless format, so compression does NOT affect image quality).
  8. click OK.


To load a colour map in W:A, copy it to your User\SavedLevels folder, or a subfolder of that folder. You can load your map in W:A by opening the map editor (right-click the map thumbnail), and selecting the map from the drop-down combo box.

Personal tools