A mix of PNG and JPEG image tiles within a GeoPackage provides both transparency and good compression across a zoom level's map coverage. Partial map tiles, e.g., those containing a border of the map, should be generated as PNG images with transparency for the border region. Whereas full coverage map tiles should be generated as opaque JPEG images with compression.
This issue was fixed via a combination of modifications in the WorldWind GeoPackage Module (worldwind-gt-geopkg) and the WorldWind GeoPackage Extension (worldwind-gs-geopkg).
GeoPackageReader (worldwind-gt-geopkg): added support for transparent PNG images by changing the image type from BufferedImage.TYPE_3BYTE_BGR to BufferedImage.TYPE_INT_ARGB and set the background fill to transparent white.
GeoPackageGetMapOutputFormat (worldwind-gs-geopkg): set the format option mime-type to "JPEG-PNG" (image/vnd.jpeg-png) so that the corresponding JpegPngMapResponse can test for the presence of transparency in an image and set the resulting map output to PNG if transparency is detected, otherwise JPEG with compression; set the tile's GetMapRequest transparent setting to true so that transparency is conditionally enabled in the super's RenderedImageMapOutputFormat.directRasterRender method.
A mix of PNG and JPEG image tiles within a GeoPackage provides both transparency and good compression across a zoom level's map coverage. Partial map tiles, e.g., those containing a border of the map, should be generated as PNG images with transparency for the border region. Whereas full coverage map tiles should be generated as opaque JPEG images with compression.