Modify

Opened 5 years ago

Closed 5 years ago

Last modified 11 months ago

#9984 closed enhancement (fixed)

layer transparency no longer works

Reported by: A_Pirard Owned by: Don-vip
Priority: major Milestone: 14.05
Component: Core imagery Version: tested
Keywords: wms tile png alpha transparency Cc: Papou

Description

I am accessing several WMS servers with &transparency=true
The WMS caches contain transparent .png files.
The Alpha channel option is set.
But the displayed layer is not transparent (it hides the background).
Used to work.

Attachments (3)

51.9 m_52.515_13.392.png (48.7 KB) - added by A_Pirard 5 years ago.
Screenshot-Java OpenStreetMap Editor-1.png (215.3 KB) - added by A_Pirard 5 years ago.
Screenshot-Java OpenStreetMap Editor-2.png (452.8 KB) - added by A_Pirard 5 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 5 years ago by Don-vip

Component: CoreCore imagery
Owner: changed from team to A_Pirard
Status: newneedinfo

Could you please tell us which WMS server are you using, and attach your status report, please? A screenshot would be nice, too.

comment:2 Changed 5 years ago by A_Pirard

Gladly.
Ah, you mean Help>Show Status Report ;-) See below. System is Ubuntu but Mint packets were added.

wms:http://fbinter.stadt-berlin.de/fb/wms/senstadt/k5?&transparent=true&FORMAT=image/png&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}&LAYERS=0
http://fbinter.stadt-berlin.de/fb/wms/senstadt/k5?&transparent=true&FORMAT=image/png&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&STYLES=&SRS=EPSG:4326&WIDTH=500&HEIGHT=500&BBOX=13.3924751,52.5146453,13.3964303,52.5170522&LAYERS=0

$ pngcheck '51.9 m_52.515_13.392.png'
OK: 51.9 m_52.515_13.392.png (500x500, 24-bit RGB, non-interlaced, 93.4%).

Tile file and two screenshots coming.

Thanks! Best regards.

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2014-04-25 17:49:40
Last Changed Author: Don-vip
Revision: 7000
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2014-04-25 19:46:38 +0200 (Fri, 25 Apr 2014)
Last Changed Rev: 7000

Identification: JOSM/1.5 (7000 en) Linux Mint 13 Maya
Memory Usage: 213 MB / 1267 MB (103 MB allocated, but free)
Java version: 1.7.0_25, Oracle Corporation, OpenJDK 64-Bit Server VM
VM arguments: [-Djosm.restart=true, -Djava.net.useSystemProxies=true]
Dataset consistency test: No problems found

Plugin: OpeningHoursEditor (30413)
Plugin: PicLayer (30413)
Plugin: RoadSigns (30413)
Plugin: editgpx (30414)
Plugin: geotools (30349)
Plugin: importvec (30413)
Plugin: jts (30277)
Plugin: opendata (30413)
Plugin: osmarender (30413)
Plugin: reltoolbox (30413)
Plugin: reverter (30413)
Plugin: tagging-preset-tester (30413)
Plugin: turnrestrictions (30413)
Plugin: utilsplugin2 (30413)
Last edited 5 years ago by Don-vip (previous) (diff)

Changed 5 years ago by A_Pirard

Attachment: 51.9 m_52.515_13.392.png added

Changed 5 years ago by A_Pirard

Changed 5 years ago by A_Pirard

comment:3 Changed 5 years ago by Don-vip

Keywords: wms tile png alpha transparency added

comment:4 Changed 5 years ago by Don-vip

Owner: changed from A_Pirard to team
Status: needinfonew

comment:5 Changed 5 years ago by skyper

Always thought it is a problem with my WMS source.

comment:6 Changed 5 years ago by Don-vip

Owner: changed from team to Don-vip
Priority: normalmajor
Status: newassigned
Type: defectenhancement

It's not a defect but a major enhancement to support these files. Java does not offer out-of-the-box support of PNG images defining a transparent color in RGB space (without real alpha channel). If it worked before with this server, then they probably delivered PNG images with alpha channel before, then switched to a different format (maybe for performances).

I have almost finished to implement this, but it's really more difficult than expected.

comment:7 Changed 5 years ago by Don-vip

Resolution: fixed
Status: assignedclosed

In 7132/josm:

fix #9984 - Add support for WMS tiles defining a transparent color in RGB space (tRNS PNG chunk for example), instead of a proper alpha channel. Surprisingly, Java does not support that out of the box, ImageIO.read always returns opaque images. Allows to switch between this mode and standard mode using WMS layer contextual entry "Use Alpha Channel", for consistency with images defining an alpha channel. Does not impact other images than WMS tiles.

comment:8 Changed 5 years ago by Don-vip

Milestone: 14.05

comment:9 Changed 5 years ago by A_Pirard

You guys @ JOSM have an outstanding support that makes me share your enthusiasm and help you the best I can !!!
Answering your question "if it worked before" and explaining my "no longer", this request was not personal but based on:
http://lists.osgeo.org/pipermail/mapproxy/2014-May/001892.html
to which I replied with image analysis (sh.. that pipermail listing HTML source code (save as *.html file and click it))
I didn't guess at all when displaying cached files and running pngcheck that transparency was not alpha.

site (4326) -> JOSM: transparent OK: 51.9 m_52.515_13.392.png
(500x500, 24-bit RGB, non-interlaced, 93.4%).<br>

In fact, I associated a bit too fast a problem with a layer of mine that used to be transparent but was no longer.
Sorry I'm unable to test it right now (server changed). I thought I had a double Mapproxy+JOSM problem.
And now should I say to Mapproxy who didn't reply that JOSM might have debugged their problem too?
Thanks !!! Kudos !!! I should be sleeping ;-)

comment:10 Changed 5 years ago by A_Pirard

As a side bonus if you like, I often notice with an often non-responding server that JOSM doesn't use its WMS cache.
I mean, if one is returning to previous work when the server no longer responds, that WMS first displays previously cached tiles, that it probably sends requests that time out for the same tiles and that it paints them in red. That's how it looks like.
That is of course frustrating to see that one could but cannot finish some work because of that.
If you think it's easy to fix, feel like doing it and need a careful test and a repeatable procedure, just say it and I'll find some time and open a proper bug.
Cheers.

comment:11 Changed 5 years ago by Don-vip

Yes, I have seen this behaviour while implementing this ticket but it's not easy to fix. By the way it's already known, look at #7363 and #7682.

comment:12 Changed 11 months ago by Don-vip

In 13823/josm:

see #9984, see #16047 - Java 11 handles transparent PNG out of the box, disable JOSM mechanisms to force transparency on this version

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.