Lunacy SVG Export Breaks Masks That Work Correctly in PNG

I’m experiencing an issue with SVG export in Lunacy where masks are not rendered correctly after exporting the design as SVG.

In my project, I use a mask to clip a group of wave shapes. The mask works correctly in Lunacy and when exporting the design as PNG. However, when I export the same design as SVG, the mask is ignored or rendered incorrectly in browsers such as Brave.

Interestingly, importing the exported SVG back into Lunacy displays the mask correctly, but exporting it again reproduces the issue.

I also tested the SVG by explicitly setting maskUnits="userSpaceOnUse" and maskContentUnits="userSpaceOnUse". This corrected the rendering in Brave, but the mask issue returned after importing the file into Lunacy and exporting it again.

Steps to Reproduce

  1. Create a design in Lunacy using a mask applied to a group of wave shapes.

  2. Export the design as PNG and verify that the mask renders correctly.

  3. Export the same design as SVG.

  4. Open the exported SVG in Brave and observe that the mask is not rendered correctly.

  5. Import the exported SVG back into Lunacy. The mask appears correctly.

  6. Export the imported SVG from Lunacy again and observe that the problem persists.

Expected Behavior

The SVG export should preserve the mask definition, coordinate system, transformations, and clipping behavior so that the exported artwork renders consistently in Lunacy and standards-compliant SVG viewers.

Actual Behavior

The mask works in Lunacy and PNG exports, but fails in Brave after SVG export. Re-importing the SVG into Lunacy does not resolve the issue, and exporting it again reproduces the problem.

Additional Information

  • Application: Lunacy

  • Export format: SVG

  • PNG export: Works correctly

  • SVG rendering in Brave: Mask fails

  • SVG re-import in Lunacy: Mask appears correctly

  • Re-export from Lunacy: Issue persists

  • Test performed: Explicitly setting maskUnits and maskContentUnits to userSpaceOnUse fixes browser rendering until the file is re-exported from Lunacy.

Could the Lunacy team investigate whether SVG export is incorrectly handling mask coordinate systems or transformations?

Thank you!

Lunacy performs best when it’s up to date. We recommend enabling beta updates: Help → About → :check_box_with_check: Check for Beta Updates. Let me know if you’re still experiencing this issue with SVGs after updating.

Thank you for the suggestion. I tried both the beta version and older versions of Lunacy, but the issue still persists.

The mask works correctly when exporting as PNG, but when exporting as SVG, the mask is not rendered correctly in Brave. Interestingly, importing the exported SVG back into Lunacy displays the mask correctly, but exporting it again reproduces the same issue.

I also tested modifying the SVG mask coordinate settings, which fixed the rendering in Brave, but the issue returned after re-exporting the file from Lunacy.

I have a proof-of-concept video demonstrating the issue. Could you please investigate whether this is related to Lunacy’s SVG mask export handling?

Thanks for clarifying! I’ll look into this and let you know as soon as I have any updates.

I tested Chrome, Brave, and Firefox, as well as beta and older versions of Lunacy, but the issue persists.

I created a simple SVG with a mask in Lunacy and manually fixed the exported SVG. I’ve attached a comparison image and both SVG files. Please take a look.

Lunacy exported SVG

<?xml version="1.0" encoding="utf-8"?>
<svg width="1034" height="1034" viewBox="0 0 1034 1034" fill="none" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <mask id="mask_1" x="143" y="137" width="704.416" height="704.416">
      <path d="M135 0L365 0C439.569 0 500 60.4314 500 135L500 365C500 439.569 439.569 500 365 500L135 500C60.4314 500 0 439.569 0 365L-1.52588e-05 135C0 60.4314 60.4314 0 135 0L135 0Z" transform="matrix(0.643 0.766 -0.766 0.643 383.022 0)" />
    </mask>
  </defs>
  <g transform="translate(5 5)">
    <rect width="1024" height="1024" fill="none" stroke-width="10" stroke="#000000" />
    <g transform="translate(160 160)" mask="url(#mask_1)">
      <rect width="700" height="900" fill="#FF0000" fill-rule="evenodd" transform="translate(105.022 -47.792)" />
    </g>
  </g>
</svg>
Repaired SVG
<?xml version="1.0" encoding="utf-8"?>
<svg width="1034" height="1034" viewBox="0 0 1034 1034" fill="none" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <mask id="mask_1" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" x="0" y="0" width="704.416" height="704.416">
      <path d="M135 0L365 0C439.569 0 500 60.4314 500 135L500 365C500 439.569 439.569 500 365 500L135 500C60.4314 500 0 439.569 0 365L-1.52588e-05 135C0 60.4314 60.4314 0 135 0L135 0Z" transform="matrix(0.643 0.766 -0.766 0.643 383.022 0)" fill="#FFFFFF" />
    </mask>
  </defs>
  <g transform="translate(5 5)">
    <rect width="1024" height="1024" fill="none" stroke-width="10" stroke="#000000" />
    <g transform="translate(160 160)" mask="url(#mask_1)">
      <rect width="700" height="900" fill="#FF0000" fill-rule="evenodd" transform="translate(105.022 -47.792)" />
    </g>
  </g>
</svg>

Thanks for sharing that! I’ve added all this info to the report. I’ll let you know as soon as there is any news.