Skip to main content

PluginAPI. exportAsync in png format degradationg since last release

  • February 25, 2025
  • 1 reply
  • 22 views

Ivan Kubota
https://www.figma.com/design/mI73MUKzF9uNkitY16SAmo/Untitled?node-id=0-3&t=BPYnmGqdZgKDKXpI-1

Bug happens when we have two elements: top one have mask operation applied to a group.

 

I made a smallest reproducable case, it is avaliable in the attached design.

 

After exporting to png format:

await node.exportAsync({ format: 'PNG' })

Exported result is looking completely different from what is displayed in playground or in the Figma player. I’ve attached the result in that document. From extracted bytes it is clear that problem is not in opacity of pixels, but in mixing the opacity back to color, or maybe in some blending process.

It does not happen in the JPG format (and in other test cases in the attached design file).

 

By the way issue is also appears when using the export dialog:

 

Our plugin is heavily relying on ability to accurately capture frames. It was not the case in previous Figma release, looks like some logic related to transparency calculation have changed.

 

Tested in figma desktop app, and in chrome. OS: Win 11.

1 reply

  • Figmate
  • 1788 replies
  • February 27, 2025

Hi ​@Ivan Kubota, Thanks for reaching out about this!

 

We appreciate you providing the test file. While we await feedback from API experts in our community, I tried exporting it using the export dialog and saw the same issue you mentioned.

 

However, I noticed that if you uncheck "Ignore overlapping layers" and export as a PNG, the frame seems to export correctly. Could you give that a try and see if it works for you?

You can find more details in “Ignore overlapping layers” section of Export formats and settings
 

Hope it helps. Thanks again for reaching out!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings