Transparent background export doesn't work for Tab fret numbers
Reported version
3.4
Type
Functional
Frequency
Once
Severity
S5 - Suggestion
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project
When exporting to .png or .svg files, the transparency works fine for everything except the numbers displayed on tabulatures. The numbers have a square white background box.
So generated files are sort of unusable to be integrated on websites and other applications with a non-white background. Here's an screenshot from Inkscape when importing the attached .svg onto a non-white background:
When changing the paper color in MuseScore, the number display fine in the application itself though.
Attachment | Size |
---|---|
broken-tab-transparency.png | 260.25 KB |
broken-tab-transparency.svg | 248.09 KB |
broken-tab-transparency-coloured.png | 65.14 KB |
Comments
Which are not transparent and on purpose, so they don't get cut through by the staff lines. So I'm inclined to close this as being 'by design'.
Workaround: don't use a non-white background
at least it isn't a bug
See libmscore/note.cpp, lines 1116-1144
In reply to Which are not transparent… by Jojo-Schmitz
Ah i see, the explanation why this happens makes total sense, but it's due to how the internals work and not because it cannot be done.
An SVG with these being exported as expected would still be possible, with the limitation that bar lines and numbers on the SVG would either need to be flattened into one large object or the bar lines being cut out where the numbers sit (maybe there are other approaches to solve this but i can't think of one right now).
For bitmaps such as PNGs no issue / questions left how this is to be done though. We simply need the mask white color for exports. The fact that i can change the paper color in the settings and everything displays fine shows it's doable - a generated PNG should be able to be used in exactly the same fashion in other applications, such as websites.
I understand it's not a regression bug and you can argue it works as designed as it was coded this way - however the export does not do what it should for PNGs, namely mask any white (or whatever the paper background color in the currently UI is) as transparent - so from a user's perspective it is clearly a bug.
I haven't claimed it to be impossible ;-)
One firm objection though: refraining from using a non-white background is not a workaround, because what would be the point of wanting to generate a transparent image in the first place? ;)
The issue is not restricted to image export, scores with a non-white baclground have it too. And a fix should not special case on.image export but rather fix it at its real cause
In reply to The issue is not restricted… by Jojo-Schmitz
I already realised paper color cannot be exported (which makes sense as it is an application preference, not a score page setting), but that's a completely different issue.
So i'm not sure i understand what you are saying.
> The issue is not restricted to image export
This issue deals with generating output files with proper transparency. Or is there anything else (apart from PNGs and SVGs) that can be exported with transparency from MuseScore?
That white back also happens in a regular score with a background color (other than white) or or a background image or wallpaper. It needs to get fixed for that case, and once that is done it would automatically be fixed for image export too
> That white back also happens in a regular score with a background color (other than white) or or a background image or wallpaper
When you say "background color", you mean "paper color" right? Cannot reproduce what you are saying (or simply i still get it wrong, apologies in that case), here's an example screenshot:
That's what i meant when i said:
> The fact that i can change the paper color in the settings and everything displays fine shows it's doable
Ah, I see. Don't see where/how this is done in the source code though