Opened 14 years ago

Closed 14 years ago

#405 closed task (fixed)

Should we support both svg and png formats for plots?

Reported by: Jari Häkkinen Owned by: Peter Johansson
Priority: major Milestone: svndigest 0.8
Component: output Version: trunk
Keywords: Cc:

Description (last modified by Jari Häkkinen)

Make the format selectable. Should the png format be default?

Change History (18)

comment:1 Changed 14 years ago by Peter Johansson

I suppose it's a good idea to let png be default just as before.

I think we should avoid supporting an infinite number of formats because it will be a nightmare to avoid regressions. So png, svg, and perhaps pdf is enough for me.

comment:2 in reply to:  1 ; Changed 14 years ago by Jari Häkkinen

Description: modified (diff)

Replying to peter:

I suppose it's a good idea to let png be default just as before.

I knew you'd say that. I'll probably be producing svg myself all the time.

I think we should avoid supporting an infinite number of formats because it will be a nightmare to avoid regressions. So png, svg, and perhaps pdf is enough for me.

Leaning on plplot I think it is trivial to support the format supported by plplot. But I agree png, svg and pdf will be enough.

comment:3 in reply to:  2 Changed 14 years ago by Peter Johansson

Replying to jari:

Replying to peter:

I suppose it's a good idea to let png be default just as before.

I knew you'd say that. I'll probably be producing svg myself all the time.

I haven't seen the beauties yet, so don't take my comment as a final vote

comment:4 Changed 14 years ago by Peter Johansson

Virtually everyone should find svg preferable over png, so why not make svg default... If we state it clearly in NEWS and make it easy to change format in config file, I think it should be fine to change (read improve) the behavior.

comment:5 in reply to:  4 ; Changed 14 years ago by Jari Häkkinen

Replying to peter:

Virtually everyone should find svg preferable over png, so why not make svg default... If we state it clearly in NEWS and make it easy to change format in config file, I think it should be fine to change (read improve) the behavior.

The svg files look really nice but they are really large. The summary plot for svndigest-trunk is over 1MB. Hm, should we generate png and svg and let the user decide which one to see in his browser?

comment:6 in reply to:  5 Changed 14 years ago by Peter Johansson

Replying to jari:

The svg files look really nice but they are really large. The summary plot for svndigest-trunk is over 1MB. Hm, should we generate png and svg and let the user decide which one to see in his browser?

No reason to generate something user won't display. I think we should generate either png or svg, and which is decided in config file. What should be default for this then? The fact that SVGs are that large make me think it might be better to stay with png as default.

For larger projects the output will get huge. The base output, for example, contains more than 27,000 images. If each of them is ~1MB we have 27GB output, but the images for Nodes are likely larger because they have more plot lines than the summary plot (which only has 3).

comment:7 Changed 14 years ago by Jari Häkkinen

Thinking that there surely must be compressed svg I browsed the we and found out that there is a standard for compressing svg with gzip ... svgz files. I examined the compression ratio for the summary_plot.svg and found it to be almost a factor 40!

#> ls -sh summary_plot.svg*
1.2M summary_plot.svg   32K summary_plot.svgz

That's more like it. The downside is that browser cannot natively handle svgz files. I tried to find information on when to expect firefox/gecko to support compressed svg but failed to find any. I made some test to browse html files with svgz rather than svg, it looked promising - firefox said that it needed to install a plug-in to display the content. Clicking on the plug-in link simply reported no plug-in found.

In conclusion, we should probably add support for svg/svgz and png. Set png as default format, create a new ticket about switching to svgz when it gets supported.

comment:8 Changed 14 years ago by Peter Johansson

Status: newassigned

comment:9 Changed 14 years ago by Peter Johansson

(In [986]) refs #405. added suopport to set image format in config file.

comment:10 Changed 14 years ago by Peter Johansson

Owner: changed from Peter Johansson to Jari Häkkinen
Status: assignednew

comment:11 Changed 14 years ago by Peter Johansson

Owner: changed from Jari Häkkinen to Peter Johansson
Status: newassigned

comment:12 Changed 14 years ago by Peter Johansson

(In [1005]) refs #405. Move replicated code to a function

comment:13 Changed 14 years ago by Peter Johansson

(In [1007]) refs #405

Support for png images, which is now default. Using alhpa channel in plstream for png did not work well in any straghtforward way so made PNGs opaque.

comment:14 in reply to:  13 ; Changed 14 years ago by Jari Häkkinen

Replying to peter:

Support for png images, which is now default. Using alhpa channel in plstream for png did not work well in any straghtforward way so made PNGs opaque.

What is the problem?

comment:15 in reply to:  14 Changed 14 years ago by Peter Johansson

Replying to jari:

Replying to peter:

Support for png images, which is now default. Using alhpa channel in plstream for png did not work well in any straghtforward way so made PNGs opaque.

What is the problem?

When I used the svg code straight ahead

pls_.scolbga(255,255,255,0); 

it gave an image with black background. From a web search it seems PNG should support alpha channel, but I did not look into the problem in more detail.

comment:16 Changed 14 years ago by Peter Johansson

(In [1008]) refs #405. support for fomrat none which is not really a format but images will be ignored.

comment:17 in reply to:  16 Changed 14 years ago by Jari Häkkinen

Replying to peter:

(In [1008]) refs #405. support for fomrat none which is not really a format but images will be ignored.

Hm, I remember having some issues with getting the alpha channel to work with svg. I'll have look but not today I busy working with flightgear.

comment:18 Changed 14 years ago by Peter Johansson

Resolution: fixed
Status: assignedclosed

(In [1009]) closes #405. document that image format is configurable

Note: See TracTickets for help on using tickets.