XuCxSxMk Posted April 13 Share Posted April 13 I have an image where I want to recolor a specific object to specific values and then export said image. Now, I would need to do this for around 200 different colors (with the same image) and I am looking for ways to automate this. From what I've found, macros would be one option but they don't allow parameterized inputs and I did not find a way to edit the macro file itself to duplicate the file and edit the values in there instead. Sadly, Affinity doesn't offer any Python or JSON API. So, I am at my (inexperienced) wits end and wanted to ask if there are other options I could pursue? Thanks! Quote Link to comment Share on other sites More sharing options...
NotMyFault Posted April 13 Share Posted April 13 I can’t imagine this can be done in any Affinity app currently. i would probably try to export as SVG and use any suitable script languages or text editor to change the color codes in a fixed place of that file and save the modified copy of the file under the name of the color. You may create a vector layer and suitable blend mode (like color). David in Яuislip 1 Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected. Link to comment Share on other sites More sharing options...
David in Яuislip Posted April 13 Share Posted April 13 6 minutes ago, NotMyFault said: I can’t imagine this can be done in any Affinity app currently. Neither can I My tuppence worth Hard to say without knowing the construction of your image and what output format you need If the specific object is a vector shape then you could export as svg and use scripting to change colours and write new svgs If it's a raster image and you want to recolour a region then you could try imagemagick with connected-components Quote Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10 Link to comment Share on other sites More sharing options...
lacerto Posted April 13 Share Posted April 13 Obsolete. Quote Link to comment Share on other sites More sharing options...
thomaso Posted April 13 Share Posted April 13 If the image area to colourize is the same for each of the 200 wanted results and varies in the colour value only you might try APub's Data Merge to load the colour from a data source, possibly as image masked in APub by the wanted pixel selection. compare: https://excelkid.com/fill-cell-with-rgb-color/ and Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1 Link to comment Share on other sites More sharing options...
thomaso Posted April 13 Share Posted April 13 Another approach, without Data Merge but Macro: Create a layer (e.g. image) which contains 200 fields each with a wanted colour. Place this below the mask of the area to colourize. Use Macro to move this layer step by step to its next colour field. Save the current result … and repeat move + save. firstdefence 1 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1 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.