The problem is there where I have overlays (they have transparency) and maps with just a few colors (compared to the sat image): land, water, some lines, roads and so on. In these cases, the resulted jp2 file has a bigger size. From 60 KiB it goes up to 80KiB. 

Is there a way to work around this? I would pretty much like to keep a standard and use only jp2, not two formats.


You should look at JPEG XR.  I think it does everything you want but I only just realized it existed so I'm not sure.

You have two, or three, different types of data and you need the best compression so you need two different algorithms.  I don't see any problem with using two formats, so long as you choose supports your user-agent handles.  If you want one format you will may up with something like TIFF, which has traditionally been extended to meet all purposes and rarely works because of that (user-agents don't support 'TIFF' they support an unpredictable small number of the sub-formats).  After all, you could use HTML - the IMG tag allows you to embed both PNG and JPEG ;-)

In other words, I wouldn't limit yourself by aiming for a single format, it's an illusion.

Other things that might work; WebP, as suggested and JPEG XR (said to support lossless compression and transparency/alpha)  JPEG XR is an ISO standard (ISO/IEC 29199-2), like PNG and the JPEGs.

I would be interested in knowing how the lossless mode of JPEG XR performs with the maps against PNG.  It may be significantly better than PNG because it treats the image in a more sensible way (as a collection of tiles rather than as a series of rows.)

John Bowler