Jump to content
Alex_M

Premultiply alpha against black color? How?

Recommended Posts

Is there a way in Affinity Photo to premultiply the alpha against black color? I'm doing some renderings and I'm getting black halos around my objects. In Photoshop there's "Remove Black Matte" and in After Effects there's "Premultiplied - Matted With Color:" What about Affinity Photo?


Affinity Photo 1.7.2.471 for Windows Windows 10 x64 1903  CPU AMD Threadripper 1950X @3.9 Ghz  RAM 32 GB GPU GTX 1080 ti 11GB NVMe SSD Samsung 960 Pro 512 GB

Share this post


Link to post
Share on other sites

Hi Alex_M :)

Unfortunately there's no 'remove black matte' option in Affinity currently, although it has been previously requested here.

I can see that you have also previously made a post of a similar nature here, where my colleague provided an answer for Defringing, if you could provide an example then we may be able to help further!

Share this post


Link to post
Share on other sites

Ok, please see the attached image. You will notice the black outline around the objects on the faucet to the left. It should look like the one to the right - no black outline. Do you have any ideas on how to get rid of the outline?

object_outline.jpg


Affinity Photo 1.7.2.471 for Windows Windows 10 x64 1903  CPU AMD Threadripper 1950X @3.9 Ghz  RAM 32 GB GPU GTX 1080 ti 11GB NVMe SSD Samsung 960 Pro 512 GB

Share this post


Link to post
Share on other sites

Sure, please see attached.

EDIT: I Think the problem stems from the way the alpha is saved. The PNG format always saves alpha premultiplied so rendering against black background produces halos around edges of objects. In Photoshop the halo can be removed with Matting > Remove Black Matte and in After Effects you just tell it weather the alpha is premultiplied or straight. How do I do that with Photo? TGA format allows choosing to save the alpha as unpremultiplied (straight). Then I don't get the black halos in neither Photoshop nor Photo.

faucet.zip


Affinity Photo 1.7.2.471 for Windows Windows 10 x64 1903  CPU AMD Threadripper 1950X @3.9 Ghz  RAM 32 GB GPU GTX 1080 ti 11GB NVMe SSD Samsung 960 Pro 512 GB

Share this post


Link to post
Share on other sites

Thanks for that Alex :)

I've played around with the files and the closest I can get is changing the Gamma settings under the blend options for the image, see below.

606d0d7c8f49c86714942f5ba5b514bc.gif

As you can see, this makes a slight difference to the black haloing around the object.

Another option, if possible to your workflow, could be to use the EXR format as a straight alpha option is available in the export options of Affinity for this format. 

Share this post


Link to post
Share on other sites

Thanks for these examples! The Apply Image filter actually seems to work best. I had to change the Opacity parameter at the bottom to 50% to make it look good otherwise I get a white outline.


Affinity Photo 1.7.2.471 for Windows Windows 10 x64 1903  CPU AMD Threadripper 1950X @3.9 Ghz  RAM 32 GB GPU GTX 1080 ti 11GB NVMe SSD Samsung 960 Pro 512 GB

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×