Affinity Rat Posted June 4, 2024 Posted June 4, 2024 I’m trying to create a way of removing all colours but black from a group of files, is there a way to automate this? My original thot was a script, but no way to run in batch mode, at least that I know of. Any ideas? I was wanting to create a macro to select black on an image, invert the selection then delete leaving only black, but first how to select black without clicking on part of image? Then how to apply in batch? Quote
walt.farrell Posted June 4, 2024 Posted June 4, 2024 Just to confirm: Are you talking about Black in Pixel layers, or in vector objects? Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
Affinity Rat Posted June 4, 2024 Author Posted June 4, 2024 Black in pixels. Clicking on black with a 23% tolerance works, but how to determine where to click in a script. Anyway to assign a black area to all images then click there to make selection? Invert, delete coloured areas Then crop black area added in. Quote
carl123 Posted June 4, 2024 Posted June 4, 2024 28 minutes ago, Affinity Rat said: Clicking on black with a 23% tolerance works, but how to determine where to click in a script. If you record a macro using the tolerance you want (23%) when you replay that macro it should select the same colour & tolerance you used to record it (I think) Affinity Rat 1 Quote To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.
David in Яuislip Posted June 4, 2024 Posted June 4, 2024 Set blend ranges in a macro, try this one, should work in a new batch job BlackOnly.afmacro 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
Affinity Rat Posted June 4, 2024 Author Posted June 4, 2024 @David in Яuislip Thank you for that, but it erased a large part of the image, but the technique does have potential. Looking at the “black” is black but rather RGB (1,0,2) or HSL (270,100,0) Quote
Affinity Rat Posted June 4, 2024 Author Posted June 4, 2024 39 minutes ago, carl123 said: If you record a macro using the tolerance you want (23%) when you replay that macro it should select the same colour & tolerance you used to record it (I think) Thanks Carl123 The problem is where to select, the macro must know where to click, all images are different. Quote
walt.farrell Posted June 4, 2024 Posted June 4, 2024 18 minutes ago, Affinity Rat said: The problem is where to select, the macro must know where to click, all images are different. Carl is saying that the color and tolerance you used for the recording will be applied when you replay the macro. The macro won't be clicking, but selecting using the parameters you used originally. (I have not tried this.) Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
Affinity Rat Posted June 4, 2024 Author Posted June 4, 2024 Ok thanks Walt for the clarification. 🙂 walt.farrell 1 Quote
Affinity Rat Posted June 4, 2024 Author Posted June 4, 2024 @carl123 Thank you very much yes that does work. 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.