stevenmiller Posted March 16 Share Posted March 16 Dear developers, There is a bug in AP2. When using live procedural filter, the functions "clampmin" and "clampmax" do not work as they should, their functionalities are swapped. E.g. clampmin is supposed to provide a "lower bound": When applying clampmin(R, 0.3) to the Red channel, 0.3 should be the lower bound, i.e. the function's result should be the R-value as long as it is greater or equal to 0.3, otherwise the result should be 0.3. However, this is not what the function does (see screenshot below): clampmin(R, 0.3) spits out the same value as min(R, 0.3) which boils down to 0.3 being an upper bound. So, the programming is wrong. Currently, you have programmed clampmin(a,LB)=min(a,LB) and clampmax(a,UB)=max(a,UB) which is wrong. Correct would be: clampmin(a,LB)=max(a,LB) and clampmax(a,UB)=min(a,UB). By the way clamp(a,LB,UB) works correctly. It would be great if you would correct this programming error. Thank you in advance. Best Steven Alfred 1 Quote Link to comment Share on other sites More sharing options...
NotMyFault Posted March 16 Share Posted March 16 I think the sequence of parameters is simply wrong. The PT documentations is next to non-exist as only types and single letter names are given without any further description. 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. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 16 Share Posted March 16 Actually, clampmin works as described: https://affinity.help/designer/en-US.lproj/pages/Workspace/expressions.html 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. Link to comment Share on other sites More sharing options...
stevenmiller Posted March 19 Author Share Posted March 19 (edited) No, it does not work as described - the sequence of inputs is correct, but it does not do what is said in the official description. The description - according to your screenshot of the official AP page - says clampmin(n,min) clamps values below minimum, BUT: It doesn't do this!! As you see from my screenshot. A red layer filled with R'=255 pure red (or normalized with R=1.0) when applying clampmin(R,0.3) should yield the same red layer because the R-values are equal to 1.0 everywhere and obviously do not go below 0.3. So the R=1.0 value should not be clamped, only values below 0.3 should be clamped and then set equal to 0.3. That is not what clampmin is doing. The programming is simply wrong. Just, look at the result: The layer is darkened and set to R-value 0.3. That should not happen. It should not alter the R-value as long as it does not go below 0.3. Edited March 19 by stevenmiller Chris J 1 Quote 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.