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

channel editing macros in Affinity Photo [free]


myclay

Recommended Posts

I have build a set of seven macros which make the channel editing as well as conversion of Affinities "RGBA" to R-G-B-A,
RGBA to RGB-A  as well as other tasks much easier and faster within Affinity Photo.

Big thanks to @NotMyFault and @,,, for their insight into Alpha channel math and how it is working inside the Affinity Suite.
The from scratch macros allow stacking transparent vectors or textlayers on top of each other.
This works as long as you keep the black fill layer for each channel intact and active.

https://myclay.gumroad.com/l/Affinity_channelEditmacros

 

1552469456_channeleditinginaffinityphoto.gif.1d62b5d58306783a2e6caef3a3cc0a4f.gif

Sketchbook (with Affinity Suite usage) | timurariman.com | gumroad.com/myclay
Windows 11 Pro - 22H2 | Ryzen 5800X3D | RTX 3090 - 24GB | 128GB |
Main SSD with 1TB | SSD 4TB | PCIe SSD 256GB (configured as Scratch disk) |

 

Link to comment
Share on other sites

I want to point out that the problem is in the export.

Affinity will mask the RGB layers with the Alpha before export. This is incorrect behavior.

Attached are public domain RGBA conversion routines that split the channels into layers and put them back together again, but do not fix the export issue. That requires work from Affinity.

CompositeToRGBA.afmacro RGBAToComposite.afmacro

Edited by lloyds
Link to comment
Share on other sites

Hello @lloyds

your scripts as you wrote, do not solve the exporting step. But my scripts allow the successful export in PNG and TGA.
Here is an ingame example I did with such an exported file;

1020226477_gameenginetest.gif.08fdcdb45c61751df99eb8c04f38d69f.gif

So for my purposes my workflow works.

 

since you uploaded your testfile in another thread, here is the result directly with an export no other changes to the file;1429721976_directexportfromaffinity.gif.2f06fff8482f417003ff191a57a168ba.gif

 

Results with my scripts and your testfile;756758505_exportwithmyscriptfromaffinity.gif.333106110e5afdae7c7aae870782881a.gif

 

Sketchbook (with Affinity Suite usage) | timurariman.com | gumroad.com/myclay
Windows 11 Pro - 22H2 | Ryzen 5800X3D | RTX 3090 - 24GB | 128GB |
Main SSD with 1TB | SSD 4TB | PCIe SSD 256GB (configured as Scratch disk) |

 

Link to comment
Share on other sites

Let me reiterate: if you read a PNG file, Affinity will mask the RGB channels with the alpha when you write that file. Even if you do nothing.

"since you uploaded your testfile in another thread, here is the result directly with an export no other changes to the file;"

You literally proved my point: exporting from Affinity to PNG will mask the RGB with the alpha by default. This is incorrect behavior. There is nothing, I repeat nothing about this behavior that is correct.

Because you manage to find a work-around does not change the fact that Affinity has an incorrect export function. It is applying the Alpha as a mask to the RGB channels.

If I read a PNG file into GIMP then export it, it does not mask the RGB channels. This is true in many programs that I have used. Affinity is the only program that does this incorrectly.

RGBA channels are MEANT and DESIGNED to be separate channels.

Edited by lloyds
Link to comment
Share on other sites

  • Staff

Hi @lloyds,

Welcome to the Affinity Forums.

I can see you have posted in multiple threads regarding this issue since creating your account, and subsequently created a bug report for this.

I am not here to discuss the specifics of the issue, our team will be sure to do this in your bug report thread - but we ask that you keep your posts regarding the issue within the bug report thread and not within 'Resources' posts such as the one above, or across other threads as this makes the issue much harder to track by our support team.

If you wish to reference other threads or replies in your bug report, you can do so by selecting the 'Share' option in the 3 dot menu to the top right of the post, and including this link in your bug report thread.

Many thanks for your understanding!

Please note -

I am currently out of the office for a short while whilst recovering from surgery (nothing serious!), therefore will not be available on the Forums during this time.

Should you require a response from the team in a thread I have previously replied in - please Create a New Thread and our team will be sure to reply as soon as possible.

Many thanks!

Link to comment
Share on other sites

Please find my updated macros.

The first breaks everything out into layers so that they may be individually edited.

The second does the necessary work to move them back into something that can be exported losslessly. Please note, there is a mask that contains the alpha layer — unfortunately it needs to be there for export to work correctly.

I’m putting these macros in the public domain, so use them as you wish.

Cheers!

EDIT: Fixed the macros. Made some mistakes.

 

RGBAToComposite.afmacro CompositeToRGBA.afmacro

Edited by lloyds
Link to comment
Share on other sites

Are you perhaps seeking feedback in why your workflow and recorded steps are outputting wrong stuff?

Edit; Here is recorded what happens when lloyds macros are used.

1314285567_lloydsmacrosaredefective.gif.f40946bbbb6b4c38d83a4d177820ceb1.gif

 

Spare channel usage to archive a genuine channel packing is possible. My second edit will soon show the results.

Edit 2;

I now built a genuine working system with using spare channels. It does the exact same as the free version already on gumroad.

1602152220_sparechannelworkflowmacrosbymyclay.gif.aa948d8c7212b8d06fa0320fb1fa7fdb.gif

@lloyds This is resources, that´s for sharing helpful tutorials, working macros, files etc and not asking help on how to build macros.

If you have further things to discuss or share, I would recommend to do so in a new thread or in private messages.

 

Edited by myclay
1 edit; showing what happens when using lloyds macros. 2 edit; added gif of spare channel packing workflow

Sketchbook (with Affinity Suite usage) | timurariman.com | gumroad.com/myclay
Windows 11 Pro - 22H2 | Ryzen 5800X3D | RTX 3090 - 24GB | 128GB |
Main SSD with 1TB | SSD 4TB | PCIe SSD 256GB (configured as Scratch disk) |

 

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.