loukash Posted January 24, 2023 Posted January 24, 2023 Believe it or not, a rudimentary vectorizer has been included with Affinity from the very launch of Publisher 1! Before you get too excited though: it only works on images with transparency, for example 1-bit images with alpha channel. But hey, better than nothing, right? Place your image into a Publisher document, the more pixels the original image has, the better Select the image and click the Edit Wrap Outline button in the main toolbar Copy Paste = Curves object: there's your image (roughly) vectorized, traced based on the transparency outline Apply fill and stroke as you see fit Optionally convert all the sharp nodes to smooth or smart nodes to make it appear less jagged, clean up as you see fit Tested in APu v1.10.6 Mac and APu v2.0.3 iPad. street79, SureWeb, Andreas CH and 12 others 9 6 Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted January 24, 2023 Author Posted January 24, 2023 Works perfectly for vectorizing bitmap QR codes: If the image doesn't have transparency yet, all you need to do is: Place the QR code image in Publisher and select it with the Move tool Context toolbar > Edit Image Switch the opened image to the Photo persona Flood Select tool > Contiguous: off > click the white background Delete (optionally enable Transparent Background to check if all white pixels are gone) Save (if PNG) or export as PNG (if JPEG, then replace the JPEG in the other afpub) proceed with Wrap Outline as above street79, NotMyFault, Robert Hansford and 3 others 3 1 2 Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
NotMyFault Posted January 24, 2023 Posted January 24, 2023 Really nice catch. 👌👍👍👍 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 January 24, 2023 Posted January 24, 2023 Remember, you can convert any color to transparent with help of blend ranges. More complex color transformations are possible with Chanel mixer or Procedural Texture filter. Use posterize or gradient map for multi-pass tracing specific color ranges. The new hue/luminosity live filter mask come handy. loukash and Glock 2 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 January 24, 2023 Posted January 24, 2023 Does it generate 2-4 nodes per pixel - at every pixel edge in principle? (No opportunity to try it on my own today) 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.
loukash Posted January 24, 2023 Author Posted January 24, 2023 (edited) 8 hours ago, NotMyFault said: Remember, you can convert any color to transparent with help of […] Yep, it opens quite a few possibilities, for instance by using some clever APh macros. 8 hours ago, NotMyFault said: Does it generate 2-4 nodes per pixel - at every pixel edge in principle? Something like that, as it seems. ^ Actually strike that, it's vice versa: more like a node per 8 pixels or so. Hence the jagged edges. Because generally that's "good enough" for text wrap, isn't it. But before posting, I did a few tests to figure out what can make a difference. In the end it boils down to the sheer amount of pixels. More is more. But… the more pixels, the more nodes. The more nodes, the more… troubles. There were a bunch of crashes and spin dumps along the way. Edited January 25, 2023 by loukash see strikethrough Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
debraspicher Posted January 24, 2023 Posted January 24, 2023 2 hours ago, loukash said: Believe it or not, a rudimentary vectorizer has been included with Affinity from the very launch of Publisher 1! Before you get too excited though: it only works on images with transparency, for example 1-bit images with alpha channel. Quote
loukash Posted January 24, 2023 Author Posted January 24, 2023 43 minutes ago, NotMyFault said: color to transparent with help of blend ranges That doesn't work non-destructively in place. The image/pixel layer must be flattened with "real" transparency. Also, the "absolute pixel grid" bug is an issue. Hence my workflow via Edit Image in a separate document, i.e. without any potential misalignment in the existing layout. Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
debraspicher Posted January 24, 2023 Posted January 24, 2023 It has a million points to it, but it works-ish. Paste into Designer (as curves). mmm 8-bit. Quote
loukash Posted January 24, 2023 Author Posted January 24, 2023 11 minutes ago, debraspicher said: It has a million points to it Straight lines are relatively easy to clean up, simply select all nodes inbetween two corners with the node-lasso and delete them. To clean up round curves, it would need a quick method to select e.g. every 2nd node, delete the "steps", then convert the rest to smooth. Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted January 24, 2023 Author Posted January 24, 2023 Here an example how to quickly vectorize a part of a photo – i.e. a pixel selection – in place: apu_trace_image_wrap_outline.mp4 Yeah, it's gonna be jagged. Get over it. That's jazz. handbooklab, Hilltop, Andreas CH and 4 others 5 2 Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted January 24, 2023 Author Posted January 24, 2023 To smooth the jagged edges, go to Designer persona and apply multiple steps of the following until you're satisfied with the result: select all nodes > apply Corner Tool > Rounded > ~20 px (or about 2 mm @ 300 dpi) > Bake Appearance select all nodes > click the Smooth Curve button a few times select all nodes > click Convert: Sharp button repeat steps 1 > 2 > 3 > etc. > 1 > 2 optionally apply Contour Tool or similar to your liking Works surprisingly well within a minute or so. Black is the initial jagged "million-nodes" vectorization of the hidden pixel layer, red overlay is a smoothed copy using several passes of the above workflow: Not all that shabby, huh? prophet 1 Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted January 24, 2023 Author Posted January 24, 2023 Aaand vice versa, using the Edit Wrap Outline you can create fake pseudo-bitmap vector shapes of smooth curves! Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted January 25, 2023 Author Posted January 25, 2023 Tracing some "vector" brushes: The trick: rasterize them first but avoid too many semi-transparent pixels. Fake "1-bit" images without antialiasing work best for tracing. And again: the bigger the better. Make sure your canvas is thousands of pixels wide for tracing. Heck, try ten thousands! (Save early, save often! ) Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
Glock Posted January 25, 2023 Posted January 25, 2023 7 hours ago, loukash said: To smooth the jagged edges, go to Designer persona and apply multiple steps of the following until you're satisfied with the result: select all nodes > apply Corner Tool > Rounded > ~20 px (or about 2 mm @ 300 dpi) > Bake Appearance select all nodes > click the Smooth Curve button a few times select all nodes > click Convert: Sharp button repeat steps 1 > 2 > 3 > etc. > 1 > 2 optionally apply Contour Tool or similar to your liking Works surprisingly well within a minute or so. Black is the initial jagged "million-nodes" vectorization of the hidden pixel layer, red overlay is a smoothed copy using several passes of the above workflow: Not all that shabby, huh? NO…Not at all…. I think I could totally live with that in 90% of my applications of the technique…. Quote
prophet Posted June 30, 2023 Posted June 30, 2023 Brilliant! The perfectionist in me will want to go in a tweak all the little crevices, but this technique is a great starting point. I think it also proves the capability for auto-trace already exists in Affinity, just needs some polish to bring it up to the "full tool/feature" level. loukash 1 Quote
Bryan Rieger Posted June 30, 2023 Posted June 30, 2023 I think this thread perfectly illustrates how one person's bug is another person's feature. Personally, I cringe every time I have to use the text wrap alpha feature in Publisher as I always end up having to go and delete 99% of the nodes and then redraw the shape (incl. curves) with a more reasonable node count which then allows me to tweak the shape to get the wrapping to work better. I'm always amazed at @loukash's ability to find endless (and ingenious) workarounds in the Affinity suite. Hopefully we see improvements to both auto-trace tool and node/geometry clean-up tools in the not-too-distant future. 🤞 loukash, handbooklab and Dazmondo77 2 1 Quote
Ldina Posted April 20 Posted April 20 @loukash Thanks...nice to know. I just tried it with a Designer file, but "smoothing" curves more than once caused Publisher to crash. It also crashed when 'smoothing' after transferring back to Designer. I'm curious if this is happening to you? Opened an all vector design in Designer v2.6.2. Duplicated the design and rasterized the duplicate (hid the original vector design for backup). This gave me a bitmap with clear background on a new pixel layer. File > Edit in Publisher Used Text Wrap feature. Copy and Paste all the created nodes onto a new Layer. Convert to smooth or smart curves (optional) Smooth Curve works once, if done a second time, it crashes Publisher. Also tried File > Edit in Designer, before smoothing the curves. It crashed there too. Smooth Curve seems to work "once", but if applied multiple times to generate a smoother variation, it always crashed the App (Publisher or Designer) for me. I also tried opening an exported PNG image directly in Publisher (instead of an Affinity document). Same thing happens if I apply 'smoothing' multiple times. Crash. Quote 2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.
loukash Posted April 20 Author Posted April 20 1 hour ago, Ldina said: I'm curious if this is happening to you? Oh, I haven't used this "feature" for quite some time, so I don't know. Some time ago I bought https://apps.apple.com/app/super-vectorizer-pro-ai-vector/id1152204742 while they offered some discount, and that works fine for me as vectorizer when needed. It could be related to the new smoothing algorithm though, which is also one of the reasons I'm sticking with v2.4.2. Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
Ldina Posted April 20 Posted April 20 24 minutes ago, loukash said: It could be related to the new smoothing algorithm though, which is also one of the reasons I'm sticking with v2.4.2. Thanks...you may be right. I don't have v2.4.2 installed, but I did try it in APub v1.10.8 and repeated smoothing doesn't cause a crash. It works in a pinch, but it leaves edges pretty jagged even after a lot of smoothing. Dedicated vectorizer is the way to go. Still very nice to know and may be handy on occasion! Quote 2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.
loukash Posted April 20 Author Posted April 20 17 minutes ago, Ldina said: I don't have v2.4.2 installed I just quickly checked in APu 2.4.2 using its three personas, and it works fine without any crash. So it must be the new algorithm and "improvements" introduced in v2.5. Which was "one step forward, two steps aside, three steps back", as far as I'm concerned. Even though we've raised our voices very early in the beta feature announcement thread: Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted April 20 Author Posted April 20 10 minutes ago, loukash said: So it must be the new algorithm and "improvements" introduced in v2.5. Hm… so now I tried my exact method as outlined in https://forum.affinity.serif.com/index.php?/topic/179630-unexpected-feature-vectorize-a-bitmap-image-directly-in-publisher/#findComment-1037287 above using APu 2.6.2 3228 BETA (which is identical to the public release), and no crashes at all. In fact, the "Smooth" button returns even somewhat better – or at least different – results than in v2.4.2. Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
loukash Posted April 20 Author Posted April 20 Ha, using my original drawing from the first post above, I made v2.6.2 crash after clicking the Smooth button a few times. So apparently it can't handle that many nodes very well. The same image doesn't do any harm in 2.4.2. Quote MacBookAir 15": MacOS Sonoma > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 18 > Affinity v2
Ldina Posted April 20 Posted April 20 27 minutes ago, loukash said: So apparently it can't handle that many nodes very well. I thought of that too, but didn't bother testing. Thanks for the additional feedback. Yes, they NEED to fix these strokes, expand stroke, smooth nodes, and all the other stroke-related issues. This is basic blocking and tackling for any vector program. Quote 2024 MacBook Pro M4 Max, 48GB, 1TB SSD, Sequoia OS, Affinity Photo/Designer/Publisher v1 & v2, Adobe CS6 Extended, LightRoom v6, Blender, InkScape, Dell 30" Monitor, Canon PRO-100 Printer, i1 Spectrophotometer, i1Publish, Wacom Intuos 4 PTK-640 graphics tablet, 2TB OWC SSD USB external hard drive.
FrancescaY Posted May 15 Posted May 15 I experience Affinity Designer 2.6.3 (Windows 10) crash on an attempt to smooth a curve (see image). Inkscape simplifies this curve without any problem, but AD only crashes. I cannot say how many nodes there, for I find no info on that (again, unlike Inkscape which tells it in the status line). Quote
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.