Page 1 of 1

MOBAC created atlases: Compression of source images?

Posted: Tue Jun 18, 2019 11:14 pm
by Pascal5
I'm creating an atlas using MOBAC with pre-downloaded and pre-processed image tiles.

My question: (A) Does the image compression ratio (JPEG or PNG) of the source images affect the final size of the atlas (because image data is being used "as is")? Or (B) is the atlas size independent of the initial compression (as the image is being decoded from its initial format)?

If (A), it would be up to me to choose the appropriate compression of my source tiles according to the image quality - atlas size tradeoff which is best for me.

If (B), there would be no point trying to save space by compressing source tiles, better keep their quality as high as possible prior to MOBAC generation.

Which format do you advise to use for best performance? AQM or SQLITE?

Thanks!

Re: MOBAC created atlases: Compression of source images?

Posted: Tue Jun 25, 2019 10:31 am
by Psyberia-Support
Hi Pascal,
Both AQM and SQLITE formats will store the initial images "as is", so the answer it A. Other formats like QCT reprocess the images and store them in their own format. This is not the case for AQM and SQLITE.
However the map creation (with MOBAC) will take much time if you choose the recompress the images.

What I'd personally recommend, is to:
- Get a large SD card (so you don't have to care about the size of stored data);
- Store your maps using the "Store area tool" (so you don't have to pre-create maps on your PC, copy them, update them, etc.)

Re: MOBAC created atlases: Compression of source images?

Posted: Thu Jun 27, 2019 8:57 pm
by Pascal5
Thanks for the answer!

Also, another question...

My atlas contains a lot of sea area, which is fairly uniform color, and which I don't mind being totally uniform. What I would like is to delete those image tiles from the atlas and have them replaced by either:
- a uniform "sea" color
- a single "generic" sea-colored tile only stored once in the atlas

Doing so would let me save a lot of space in my atlas without suffering from white patches of uncovered sea areas.

Upon analysing the structure of a SQLite atlas file, it doesn't seem that any of these options is supported. Is it the case? Or is it only a MOBAC limitation?

Is there any atlas file format that would let me do such optimisation?

PS. I don't mind doing some Python programming and some SQLite database manipulation if that is required.

Re: MOBAC created atlases: Compression of source images?

Posted: Tue Jul 02, 2019 2:41 pm
by Pascal5
Let me be more specific on my problem:

I'm trying to create a detailed photoimagery atlas on an area where sea covers more than 80% of the total surface (for example, the Greek coast, sea and islands). I need high resolution on the land and islands, whereas low resolution images, or eventually a generic uniform "sea blue" color is fine enough to cover the sea areas.

I have all the tools necessary to create the image tile data suiting my needs. Still, I realised that a uniform coverage of the sea at high resolution accounts for more than half of the total size of the atlas (I haven't found any way to create a unicolor 256x256 jpg image tile smaller than 4KB). And, unfortunately, simply omitting these tiles from the atlas creates disturbing white areas in the map display.

To alleviate this, I see several options.

A : Find a way to tell AlpineQuest that omitted images should be replaced by a given color rather than drawn white. Is there a way I can do that? Is there an atlas file format that support this? (I've been looking into the SQLite format and didn't find any relevant field).

B : Have AlpineQuest to render upscaled low-resolution image tile areas where high-resolution image tiles are missing. Is there a setting to activate this?

C : Have AlpineQuest to render a "generic" sea tile only stored once in the atlas. (Again, I didn't find any possibilty in the SQLite format since tile image datas are stored directly for each grid cell, rather than a reference to an image data table).

D : Create an hybrid SQLite atlas that mixes jpg image tiles for land, and png image tiles for sea. I found out that a uniform color 256x256 png tile is 0.8KB, and only 0.08KB at 16x16. Does AlpineQuest support such jpg+png mixes in the atlas? And mix tile resolution as well? (MOBAC doesn't allow to mix jpg and png, I have to use my own tools for creating them. Or eventually, would a TMS zip atlas do the trick?)

Which direction do you advice me to follow? Do you have any technical details that could be of any help for me?

Re: MOBAC created atlases: Compression of source images?

Posted: Sat Jul 06, 2019 10:33 am
by Psyberia-Support
Hi again Pascal and sorry for the delay.
In case you still don't have found a suitable solution, here are some answers and ideas:
A: Unfortunately I don't know any format doing that.
B: Yes and no. AQ will upscale low-resolution images only if there is not a higher resolution zoom level. So it only happens for images of the last level of details.
C: Not possible.
D: AQ does support multi formats atlases. You can mix any image formats as long as they are natively supported by Android (jpg, png, gif, bmp). Concerning the mix of resolution, you're not supposed to do that (no format allows it), so I don't know what will be the result in the app (I don't know if the smaller images will stretched or not, it's possible). Just test it.

So:
- D seems your best option. You can also try to encode your uniform sea tiles in GIF with only one color palette (but I don't how how it will be compared to PNG).
- Another idea: make a "background" map with only your sea color all over. Then make your regular map with all sea tiles removed. Finally display first the sea map, then display over the regular map. This way you'll have missing areas showing the sea map underneath (so you don't have the white areas).

Hope it helps

Re: MOBAC created atlases: Compression of source images?

Posted: Sat Jul 06, 2019 12:36 pm
by Pascal5
Thanks for the detailed answer!

So I went for the D option, after discovering a compression mode which allows a 256x256 PNG uniform color image tile to be only 103B size.

I had to write my own custom sqlite exporter for that, as MOCAC doesn't support mixing PNG and JPG tiles. Fortunately it's quite straightforward, it can be done in Python with less than one page of code.

Although not optimal, so far all this works quite well.

I have attempted to use 1x1 PNG images (75B). That doesn't break AlpineQuest, but there is a slight color shift visible on those tiles which I can't explain. OK, let's forget this, there is no much extra to save doing so.

Ultimately, I would like to see AlpineQuest perform B correctly (displaying upscaled lower-resolution tiles areas where current resolution tiles are missing, instead of just blank), eventually as an option. That would greatly enhance the possibility of creating largs-scale multiresolution atlases which bring high-resolution maps for some areas of interest!

And thank you again for your great piece of software!