NotMyFault Posted April 11 Posted April 11 Hi, I often need to inpaint certaint areas from an image. i created a test with ideal conditions. Using a fresh photo I add a black symbol, 100% black, sharpest possible edges with unavoidable blurriness of 1px at edge. now the process to select the symbol, grow it by 2-4px, and you start to notice a first hurdle: any pixel based selection tools like brush or AI selection create unnecessary blurry edges if you boost contrast on alpha you see that semitransparency reaches wide into the selection. Colors of semitransparent areas are mostly too dark, even in case you add a white backfill layer. when you try to directly inpaint the area, you get very bad results with black patches. my usual workflow is trying to Grow the selection delete any semitransparent areas grow again Inpaint unfortunately Affinity bytes back and creates semitransparent inpaint. it takes much to much effort to get usable results with inpainting. You need to manually erase any content to avoid color spill coming through, and need to achieve binary alpha values (no semitransparency) to avoid getting semitransparent results. this issue affects all platforms. in case Affinity things no bug, please explain the workflow to reliably inpaint objects wich are easy to spot due to high contrast. all gets worse when you try to inpaint the right bracket which needs more careful approach for the blossom area. my solution is using the patch tool instead and only use inpaint to improve the edge area as final touch. 1 starting point 2 AI selection looks good at first sight 3 second look shows soft blurry edges and unexpected superfluous semitransparency 4 detail of semitranscy outside 5 a curves adjustment shows by boosted transparency how far the transpancy issue goes 6 inpainting in this state produces garbage, too much transparency 7 growing selection trying to cut into fully opaque areas 8 I manually erased inside the selection to remove any semitransparency with limited success 9 agai bad result of inpaint 10 10 slightly better, edge area still bad. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K 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. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
NotMyFault Posted April 11 Author Posted April 11 File saved with history inpaint issues semitransp.afphoto Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K 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. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
NotMyFault Posted April 11 Author Posted April 11 Side note : as always since years, during the shown process Photo stops working after editing a few minutes. the merged pixel layer thumbnail did not render and stays empty, and in-canvas rendering was wrong. i need to go to Home Screen and open again the files. this eliminates all UI choices for fill tool. so again open filters Choose „color“ category scroll to fill choose fill change mode to inpaint wait 10 seconds to get a preview this happens dozens of times every day, with any possible edits. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K 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. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
NotMyFault Posted April 11 Author Posted April 11 I tried again using flood selection. Same problem of semitransparency. only if I grow by 8px, the edge seems large enough for inpaint to avoid providing semitransparent results. in more critical Images, there is no chance to get that large edges all around, and manually adjusting edge width is cumbersome. the main problem is that all selections tools (no refine used) create unwanted semitransparent edges 30 pixel deep into areas that are 100% black and show stronges possible contrast to outside areas. Why is Affinity unable to take a full black area as one uniform object? Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K 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. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
Staff NathanC Posted April 17 Staff Posted April 17 Hi @NotMyFault, My understanding is these problems with semi-transparent areas arise as a result of the initial selection method used rather than a Fill/Inpaint problem, more specifically the AntiAliasing/Soft edges parameter creating softer, semi-opaque selections which in turn affect Inpaint. In the case of the ML object select this would be down to a limitation of the model with this image based on what areas it considers part of the object when soft edges is enabled, which may include semi-transparent areas. It is possible to achieve a 'Cleaner' Inpaint using this tool via the following steps: ML Object select the bracket Delete Select menu -> Deselect Select menu -> Select Transparency Range -> Select Partially Transparent Filters -> Fill Tool -> Inpaint -> Apply Deselect Turning Soft edges off resulted in a poorer initial selection, so this method opts to keep soft edges enabled and to re-select using the 'Select Partially Transparent' option prior to inpaint fill. I can't say I was finding any semi-transparency issues with the flood select using via below method, the grow/shrink was required to ensure that the black edges were not sampled via the Inpaint algorithm, but it's key that AA is toggled off. Select the flood fill tool, disable Antialiasing and set the tolerance to a low value (1%), contiguous off Flood Select the bracket Select menu -> Grow/Shrink Increase value to ~8px radius to avoid black edges being sampled by Fill inpaint Delete Filters -> Fill Tool -> Inpaint -> Apply Deselect I could equally do this with the selection brush provided 'Soft edges' was disabled to prevent it from creating a semi-transparent selection. Quote
NotMyFault Posted April 17 Author Posted April 17 Thank you for your nice and extensive reply. It clears up a little bit insofar semitransparent edges are incompatible with inpainting. I can’t follow this conclusion: 29 minutes ago, NathanC said: My understanding is these problems with semi-transparent areas arise as a result of the initial selection method used rather than a Fill/Inpaint problem, Using soft edges is a key functionality and feature of selections, so if any tool is unable to work with semitransparent areas it is a bug or restriction of the tool, not the selection. The confusion is amplified by the usual tutorials (and you post) who always recommend to use 32 minutes ago, NathanC said: Select menu -> Select Transparency Range -> Select Partially Transparent This implicitly says „use semitransparency“. It is illogic to say you can’t create selections with soft edges (equals semitransparent areas), and the recommended to use this command. in principle you would need add the step after 7: erase selected area to achieve fully transparent areas, then select fully transparent areas. the next issue is that this works only for otherwise fully opaque layers, otherwise you would need even more steps to intersect (restrict) the selection. the whole process is painful complex and needs improvement. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K 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. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
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.