News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[request] map generation from png image

Started by Phystam, December 18, 2019, 05:14:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Phystam

Hello,

I have an idea about map generation.
Currently the game accepts only BMP or PPM images, however the file formats have really large file size since they are not compressed formats. So when I create large grayscale map files, the maps spend a lot of storage.
If the map generator accepts also png file, it is very helpful to reduce map file size.

Leartin

There was a patch in the works to support PNG for inline images, which would have added them for map import as well. Was a while ago, but for completions sake: https://forum.simutrans.com/index.php/topic,15049.0.html

Yona-TYT

Quote from: Leartin on December 18, 2019, 05:57:31 PMThere was a patch in the works to support PNG for inline images, which would have added them for map import as well. Was a while ago, but for completions sake: https://forum.simutrans.com/index.php/topic,15049.0.html
How much nostalgia .  ::'(

prissi

That patch was never finished unfortunately, it had issues with the water line etc. Adding PNG reading support would be easy, but then those must be lossless compressed PNG. Otherwise the nosie will do strange things around hills and river.

About size, a BMP 256 color (greyscale) can be compressed by RLE, and then is quite small.

Mariculous

png is by definition either uncompressed or lossless compressed.

For sure one can use some special techniques like reducing the number of colors in an image to allow for better compression rates but this is not part of the png specification.

prissi