myclay Posted February 23, 2023 Share Posted February 23, 2023 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 NotMyFault and Paul Mudditt 2 Quote Sketchbook (with Affinity Suite usage) | timurariman.com | artstation store Windows 11 Pro - 23H2 | 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 More sharing options...
lloyds Posted February 27, 2023 Share Posted February 27, 2023 (edited) 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 February 27, 2023 by lloyds Quote Link to comment Share on other sites More sharing options...
myclay Posted February 27, 2023 Author Share Posted February 27, 2023 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; 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; Results with my scripts and your testfile; Quote Sketchbook (with Affinity Suite usage) | timurariman.com | artstation store Windows 11 Pro - 23H2 | 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 More sharing options...
lloyds Posted February 27, 2023 Share Posted February 27, 2023 (edited) 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 February 27, 2023 by lloyds Quote Link to comment Share on other sites More sharing options...
Dan C Posted February 28, 2023 Share Posted February 28, 2023 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! myclay and Patrick Connor 2 Quote Link to comment Share on other sites More sharing options...
lloyds Posted February 28, 2023 Share Posted February 28, 2023 (edited) 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 February 28, 2023 by lloyds myclay 1 Quote Link to comment Share on other sites More sharing options...
myclay Posted March 1, 2023 Author Share Posted March 1, 2023 (edited) 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. 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. @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 March 1, 2023 by myclay 1 edit; showing what happens when using lloyds macros. 2 edit; added gif of spare channel packing workflow Quote Sketchbook (with Affinity Suite usage) | timurariman.com | artstation store Windows 11 Pro - 23H2 | 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 More sharing options...
Recommended Posts
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.