Jump to content
You must now use your email address to sign in [click for more info] ×

Why does this transparency have holes in it?


Recommended Posts

6 minutes ago, MEB said:

Hi AntiqueFlaneur,
I'm having trouble reproducing this. What OS are you running? Windows 10? If you go to Affinity Photo Preferences, Performance section and disable OpenCL compute acceleration (on bottom) does it export correctly?

I use MacOs Big Sur. There doesn't appear to be an OpenCL Compute Acceleration option under performance preferences. 

Screen Shot 2021-02-17 at 11.49.25 AM.png

Link to comment
Share on other sites

5 minutes ago, AntiqueFlaneur said:

Here are my export settings, if it matters.

I don’t see why it should matter, but did you have a particular reason for choosing the ‘PNG-8 (dithered)’ preset?

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.5.1 (iPad 7th gen)

Link to comment
Share on other sites

Could it be that you used the magic wand to select then delete the background, with the contiguous box unchecked and with too high a tolerance. This would find and delete any part of the image too like your background.

John

Windows 11, Affinity Photo 2.4.2 Designer 2.4.2 and Publisher 2.4.2 (mainly Photo).

CPU: Intel Core i5 8500 @ 3.00GHz. RAM: 32.0GB  DDR4 @ 1063MHz, Graphics: 2047MB NVIDIA GeForce GTX 1050

Link to comment
Share on other sites

On iPad, i get the same artifacts when using PNG-8 (dithered)’ preset

I found via google that PNG8 only supports binary (0 or 1) transparency. This explains the artefacts: alpha below 1 gets rounded to 0.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected.

 

Link to comment
Share on other sites

If someone needs to spot areas where alpha is not euqal to 1, this procedural text filter will show.

This will help to to tune masks.

image.thumb.png.f72523fc5796f1b4ae4777cb8de8ab7b.png

 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected.

 

Link to comment
Share on other sites

  • Staff
2 hours ago, NotMyFault said:

alpha below 1 gets rounded to 0

I feel the export algorithm should do better than that and only alpha less that 50% would go out as transparent  . Perhaps I am missing a subtlety but this feels like a bug @Pauls do you agree?

Patrick Connor
Serif Europe Ltd

"There is nothing noble in being superior to your fellow man. True nobility lies in being superior to your previous self."  W. L. Sheldon

 

Link to comment
Share on other sites

10 hours ago, Patrick Connor said:

I feel the export algorithm should do better than that and only alpha less that 50% would go out as transparent  . Perhaps I am missing a subtlety but this feels like a bug @Pauls do you agree?

At least the current way is consistent with how mask are treated in layer stacks. 
There is no silver bullet, Affinity may make this threshold a parameter in the export dialogue.

The real issue is somewhere else: Alpha values other than 0 and 1 will lead to unexpected results (when the function must round to 0 or 1), a selectable threshold will only vary the unexpected. 

I would suggest Affinity should present a warning

  1. when the alpha values would be rounded by the function (lost information)
  2. AND alpha values exist in the image that could get truncated
  3. so no warning if alpha is 0 /1 for all pixels

Then, it would be great if the app would offer a kind of preview emphasizing the affected areas (similar to overexposed areas, or red selection overlay). Maybe the existing preview in the masking dialogue could be reused here. The preview should use only black for 0, white for 1, and red for everything in between. 
I could provide these as new version of the procedural texture filter.

In the example of the original author of this thread, the mask needs some tweaking before it could be used for export, a different threshold would not help to fix the issue.

kind regards,

Timo

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected.

 

Link to comment
Share on other sites

Following up the idea of "color overlay" to identify areas with alpha values in risk of clipping:

 

With help of a procedutal texture live filter, you can re-color all "partial" alpha values in red.

  • alpha = 0: black
  • alpha = 1: white
  • 0 < alpha < 1: red

 

 

image.thumb.png.882ebe505a86c99519ef26d2ebe2d73e.png

Edited by NotMyFault
Typos

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected.

 

Link to comment
Share on other sites

1 hour ago, NotMyFault said:

I would suggest Affinity should present a warning

  1. when the alpha values would be rounded by the function (lost information)
  2. AND alpha values exist in the image that could get truncated
  3. so no warning if alpha is 0 /1 for all pixels

I suggest that the Affinity apps should present a warning whenever alpha transparency has been used but the chosen output format doesn’t support it. That would cover formats that don’t support transparency at all, as well as formats that only offer limited transparency options.

Alfred spacer.png
Affinity Designer/Photo/Publisher 2 for Windows • Windows 10 Home/Pro
Affinity Designer/Photo/Publisher 2 for iPad • iPadOS 17.5.1 (iPad 7th gen)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.