The International Simutrans Forum

Development => Extension Requests => Topic started by: Phystam on December 18, 2019, 05:14:46 PM

Title: [request] map generation from png image
Post by: Phystam on December 18, 2019, 05:14:46 PM
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.
Title: Re: [request] map generation from png image
Post by: Leartin on December 18, 2019, 05:57:31 PM
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
Title: Re: [request] map generation from png image
Post by: Yona-TYT on December 22, 2019, 03:50:22 AM
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 .  ::'(
Title: Re: [request] map generation from png image
Post by: prissi on January 20, 2020, 03:34:18 AM
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.
Title: Re: [request] map generation from png image
Post by: Mariculous on January 20, 2020, 03:47:21 AM
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.
Title: Re: [request] map generation from png image
Post by: prissi on January 21, 2020, 12:27:49 AM
Ok, indeed, my error.