Planetdune Posted December 31, 2024 Posted December 31, 2024 (edited) Hello I notice a lot of white in my image is not 100% white. If I use a color picker, the values are somewhere around the 240 to 248 for the RGB values. Is there a way to select let's say all pixels in an image that are 235+ for all three values (RGB) and then replace those pixels with pure white? (and of course leave all pixels that have at least 1 value below 235 alone) Thanks! Edited December 31, 2024 by Planetdune Quote
Oufti Posted December 31, 2024 Posted December 31, 2024 You could experiment with a Curves adjustment: https://affinity.help/photo2/English.lproj/pages/Adjustments/adjustment_curves.html Quote Affinity Suite 2.5 – Monterey 12.7.5 – MacBookPro 14" 2021 M1 Pro 16Go/1To I apologise for any approximations in my English. It is not my mother tongue.
carl123 Posted January 1 Posted January 1 Someone on this forum showed another user a way to use a Procedural Texture filter to target a range of RGB values in an image but I cant find it at the moment Hopefully someone else will be able to point you to it 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.
thomaso Posted January 1 Posted January 1 3 hours ago, carl123 said: Someone on this forum showed another user a way to use a Procedural Texture filter to target a range of RGB values in an image but I cant find it at the moment Here's an example from @lepr: (Unfamiliar with Procedural Texture, I don't get any change with this specific input … while it generally affects the image with a different setting) carl123 1 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
carl123 Posted January 1 Posted January 1 5 minutes ago, thomaso said: Here's an example of @lepr: Thanks, not the one I was thinking of - which allowed you to target a range of numbers Hopefully, someone can remember that one for the OP 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.
lepr Posted January 1 Posted January 1 18 hours ago, Planetdune said: I notice a lot of white in my image is not 100% white. If I use a color picker, the values are somewhere around the 240 to 248 for the RGB values. Is there a way to select let's say all pixels in an image that are 235+ for all three values (RGB) and then replace those pixels with pure white? (and of course leave all pixels that have at least 1 value below 235 alone) thomaso and carl123 1 1 Quote
thomaso Posted January 1 Posted January 1 52 minutes ago, lepr said: max(R, step(t/255, min(R, G, B))) Nice. – Can PT also be used to affect 'grays' only (if R, G, B have ca. same values)? – Or/and with a soft edge? PT light > white.m4v Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
NotMyFault Posted January 1 Posted January 1 2 hours ago, thomaso said: Nice. – Can PT also be used to affect 'grays' only (if R, G, B have ca. same values)? – Or/and with a soft edge? Possible yes. But the formulas get quite complex soon. to identify grey values: var isg=1-sign(max(R,G,B)-min(R,G,B)); 1 if grey, 0 if not grey Now combine this var with lerp (a,b,c) to deliver either unchanged RGB or changed Grey values. AffinityMakesMeWonder and thomaso 1 1 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.
thomaso Posted January 2 Posted January 2 18 hours ago, NotMyFault said: var isg=1-sign(max(R,G,B)-min(R,G,B)) Thanks! Actually, with "ca. same values" I didn't mean to identify pure neutral grays but a range of grays with subtle tints of colours, a kind of +/- deviation from identical values. Never mind, it exceeds this thread and the OP's request. And, yes, I see the complexity and I still need to understand that PT is "just maths" rather than a script language for more complex conditions, not to mention limitations in the interface of Affinity's PT dialog window and the limited Affinity help which doesn't list "isg" for instance and mentions "sign" but without a note about its usage. An online search leads me to lists or tables of "maths symbols" as kind of single 'characters', without "isg" or "sign" or the large range of 'words' listed in the Affinity help. So it appears I lack the general skills to understand how to handle PT inputs. Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
NotMyFault Posted January 2 Posted January 2 Isg (is grey)is just a Self Chosen name for the variable, not a predefined function. for estimate values, we can use the step function to allow certain variance of values. When I’m retired and have more time I will write a cross compiler which translates regular if / then / else / and / or / less / equal functions into PT syntax. Any macro language can do that. But I hope Affinity will release a general scripting earlier. thomaso 1 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 2 Posted January 2 Here a formula to select grey pixels with a selectable tolerance (roughly saturation): RGB vec3(R,G,B) A var isg=1-sign(max(R,G,B)-min(R,G,B)-a); isg input variable a (tolerance) of type 0,1 0: only pure grey 1: includes fully saturated colors thomaso 1 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.
thomaso Posted January 3 Posted January 3 3 hours ago, NotMyFault said: includes fully saturated collards https://www.genussguide-hamburg.com/top-listen/gruenkohl/ 😋 NotMyFault, R C-R and Alfred 1 2 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
Ldina Posted January 3 Posted January 3 4 hours ago, NotMyFault said: Here a formula to select grey pixels with a selectable tolerance (roughly saturation): RGB vec3(R,G,B) A var isg=1-sign(max(R,G,B)-min(R,G,B)-a); isg Thank you for the PT equations. Question...what does "vec3(R,G,B) do and why is it needed? I didn't notice any difference whether that was included or removed. I'm just trying to learn a bit more about PT filters and equations. Thanks. 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
NotMyFault Posted January 3 Posted January 3 It is creating a vector from the RGB color channels. You may modify this to make any desired adjustments to the color values. Is redundant at this stage, just the „anchor“ for future modifications Ldina 1 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.
Ldina Posted January 3 Posted January 3 4 hours ago, NotMyFault said: It is creating a vector from the RGB color channels. You may modify this to make any desired adjustments to the color values. Is redundant at this stage, just the „anchor“ for future modifications Thanks for that. I have no idea how to use the vector function, but will have a look. If you have any examples (and time), I'd love to learn more about using vectors, how they work, etc. 👍 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
AffinityMakesMeWonder Posted January 3 Posted January 3 On 1/1/2025 at 6:56 PM, NotMyFault said: Possible yes. But the formulas get quite complex soon. to identify grey values: var isg=1-sign(max(R,G,B)-min(R,G,B)); 1 if grey, 0 if not grey Now combine this var with lerp (a,b,c) to deliver either unchanged RGB or changed Grey values. f***in’ great to see people handle more traditional middleschool math. Thanks! Question, is it possible to share a ready Preset file on your amazing equations? Quote Happy guy playing around with the Affinity Suite - really love typographic, photographing, Color & forms, AND, old Synthesizers from the 1980-1990’s… Macbook Pro 16” M1 2021 connected to an 32” curved 5K external display, iPad Pro 12.9” M1 2021, iPad Pro 10.5” A10X 2017, iMac 27” 5K/i7 late 2015 - also an Lenovo iMac i7 clone with 24” touch screen and Windows 10…
AffinityMakesMeWonder Posted January 3 Posted January 3 Just now, AffinityMakesMeWonder said: f***in’ great to see people handle more than traditional middleschool math. Thanks! Question, is it possible to share a ready Preset file on your amazing equations? Quote Happy guy playing around with the Affinity Suite - really love typographic, photographing, Color & forms, AND, old Synthesizers from the 1980-1990’s… Macbook Pro 16” M1 2021 connected to an 32” curved 5K external display, iPad Pro 12.9” M1 2021, iPad Pro 10.5” A10X 2017, iMac 27” 5K/i7 late 2015 - also an Lenovo iMac i7 clone with 24” touch screen and Windows 10…
NotMyFault Posted January 3 Posted January 3 22 minutes ago, AffinityMakesMeWonder said: Question, is it possible to share a ready Preset file on your amazing equations? Yes, I can export either a file with that PT filter, or export the settings. Unfortunately it is a bit time consuming, and I often use Beta Releases so older Releases won’t open the files. And I mostly use iPad which doesn’t allow to edit formulas, so I fall back providing the formula as text for a quick reply. 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.
Ldina Posted January 3 Posted January 3 13 minutes ago, NotMyFault said: Yes, I can export either a file with that PT filter, or export the settings. Unfortunately it is a bit time consuming, and I often use Beta Releases so older Releases won’t open the files. And I mostly use iPad which doesn’t allow to edit formulas, so I fall back providing the formula as text for a quick reply. Whatever is easiest for you is fine by me. I have the beta, and can download the latest beta version if that's what you send. At your leisure. Thanks. 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
AffinityMakesMeWonder Posted January 4 Posted January 4 8 hours ago, NotMyFault said: Yes, I can export either a file with that PT filter, or export the settings. Unfortunately it is a bit time consuming, and I often use Beta Releases so older Releases won’t open the files. And I mostly use iPad which doesn’t allow to edit formulas, so I fall back providing the formula as text for a quick reply. Thanks for a quick answer. Maybe I have to look harder on that screenshots and figure out a working equation. Goodnight from Sweden! Quote Happy guy playing around with the Affinity Suite - really love typographic, photographing, Color & forms, AND, old Synthesizers from the 1980-1990’s… Macbook Pro 16” M1 2021 connected to an 32” curved 5K external display, iPad Pro 12.9” M1 2021, iPad Pro 10.5” A10X 2017, iMac 27” 5K/i7 late 2015 - also an Lenovo iMac i7 clone with 24” touch screen and Windows 10…
R C-R Posted January 4 Posted January 4 44 minutes ago, AffinityMakesMeWonder said: Maybe I have to look harder on that screenshots and figure out a working equation. The screenshots plus the accompanying text should tell you all you need for that. Just keep in mind that the "RGB" & the "A" in the text represent which buttons should be enabled in the equations -- so "A" means just the alpha button while "RGB" means all 3 of those buttons. AffinityMakesMeWonder 1 Quote All 3 1.10.8, & all 3 V2.6 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7 All 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7
thomaso Posted January 4 Posted January 4 15 hours ago, NotMyFault said: Koch ich doch selbst Das dachte ich mir schon, just because of this special autocarrot … ich hatte nur noch nicht das Amuse-Gueule aus deiner Küche. 10 hours ago, Ldina said: I'd love to learn more about using vectors, how they work, etc. 👍 Me too. I suspect that the term “vector” corresponds to the colour channels R, G, B, similar to the “vectors” of HSL. 10 hours ago, AffinityMakesMeWonder said: is it possible to share a ready Preset file on your amazing equations? Attached a file with both @lepr's + @notmyfault's PT recipes combined. You can play with the two sliders in the lower part of the panel to affect the grayish background in different ways (compare the OP's initial request). The possibilities with PT are very interesting, but honestly I would only use the recipes here for a rough result, unless there were further refinement options, such as a soft edge. The antialiased edges of the 3 fully saturated colour fields probably also need special treatment so that they do not compete with the halftones in the photo. PT grays > white & exclude colour.afphoto AffinityMakesMeWonder and NotMyFault 1 1 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
AffinityMakesMeWonder Posted January 4 Posted January 4 6 hours ago, thomaso said: Das dachte ich mir schon, just because of this special autocarrot … ich hatte nur noch nicht das Amuse-Gueule aus deiner Küche. Me too. I suspect that the term “vector” corresponds to the colour channels R, G, B, similar to the “vectors” of HSL. Attached a file with both @lepr's + @notmyfault's PT recipes combined. You can play with the two sliders in the lower part of the panel to affect the grayish background in different ways (compare the OP's initial request). The possibilities with PT are very interesting, but honestly I would only use the recipes here for a rough result, unless there were further refinement options, such as a soft edge. The antialiased edges of the 3 fully saturated colour fields probably also need special treatment so that they do not compete with the halftones in the photo. PT grays > white & exclude colour.afphoto Thanks for that file! I’m sitting here with my morning coffee and my iPad, but I will test this later on my Macbook Pro. Me too have discovered this area interesting concerning equations and PT (after many many years in the Affinity community)… Quote Happy guy playing around with the Affinity Suite - really love typographic, photographing, Color & forms, AND, old Synthesizers from the 1980-1990’s… Macbook Pro 16” M1 2021 connected to an 32” curved 5K external display, iPad Pro 12.9” M1 2021, iPad Pro 10.5” A10X 2017, iMac 27” 5K/i7 late 2015 - also an Lenovo iMac i7 clone with 24” touch screen and Windows 10…
Ldina Posted January 4 Posted January 4 12 hours ago, thomaso said: Me too. I suspect that the term “vector” corresponds to the colour channels R, G, B, similar to the “vectors” of HSL. Thomaso, thank you for this comment. I hadn't considered that "vectors" in this context referred to HSL or HSV color models, but it made a lot of sense. That was one very big, missing key to my understanding! I created a PT filter to test this, and for vec3(R, G, B), I entered vec3 (0.5, 0.8, 0.1), and checked all of the RGB channel boxes so they were active. It gave me a solid yellow-green color. This matches the color I get if I enter the following numbers in the RGB channels...127 Red (0.5 X 255), 204 Green (0.8 X 255), and 25 Blue (0.1 X 255). So, it looks like that vec3 function is converting those RGB values (in 0 to 1 terms) to HSL values. The Info Panel shows that these RGB numbers result in 86H/78S/45L (which is the resulting output of that vector function and numbers). I'm still not sure exactly what to do with it, but at least I know what vec3 does now!! Thanks. thomaso 1 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
NotMyFault Posted January 4 Posted January 4 42 minutes ago, Ldina said: So, it looks like that vec3 function is converting those RGB values (in 0 to 1 terms) to HSL values This is not correct. vec3 simply stores the 3 parameters in a different format, and does not convert in any way. a vector is just an array of values, 3 in the case of vec3, and allows to apply functions on all its values in one step. You can then extract its values again, by adding .x (or .y or .z) to the vector. Vectors simply allow to write the formulas more compact. And vectors are a mathematical term to represent 2 or 3 (or any number of) dimensional values, used commonly in graphic apps to represent 2D or 3D coordinates or color values in any color format (RGB, HSL, CMYK, …). The numbers from 0 to 255 in the color panel can be shown in different units, either 0-255 or 0-1 (by dividing by 255) or hexadecimal 00 to FF. This is a feature of color panel, not of vec3. more compact way AffinityMakesMeWonder, thomaso and Ldina 2 1 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.