NMLTutorial/Graphic files

From TTWiki
< NMLTutorial
Revision as of 13:04, 22 August 2011 by FooBar (talk | contribs) (create page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

You can use any graphics file format as long as it's supported by the Python Image Library and as long the graphics file has one of the TTD palettes applied.

What image files should I use?

If you're unsure about what file format to use, take PNG as a safe bet. It can work with palettes and has the added advantage that it can be viewed by browsers and as such you can just upload your sprite files to the forums if you want to show them. PNG files are also widely supported by graphics editors.

What's this palette business?

Graphics for TTD can only use a limited set of colours (OpenTTD 32bpp graphics are an exception to this; while NML can handle these for you, it is not covered in this tutorial). Check the NewGRF Specs for what these palettes are and which colours are available to use. The DOS palette has a few more colours, so if you're still in the position to choose, go for that.

In theory you can draw in full-colour and then convert your result to the TTD palette, but that usually doesn't work out too well. It's best to only use the colours from the palette in the first place. Each sprite should get a blue background, for which you use the blue from index 0 (indicated as "Transparent" on the page of the link above, or hex colour #0000FF).

Make sure to actually save the graphics files with a palette applied, or NML will complain that you don't have one. If you don't have this palette, you can extract it from any decoded grf file or download a premade palette file.

Using palettes

This section covers how to apply a palette to a graphics file in several graphics editor. If you're editor is not listed here and you know how to work with palettes using it, please add it here.

Adobe Photoshop

To be added.

GIMP

To be added.


NML Tutorial: Graphic files