John Rostron Posted April 20, 2020 Share Posted April 20, 2020 In a recent posting @skitchy enquired about shifting pixels using Procedural Textures. I was not able to help, but I realised that you could perform an Affine Transformation (Filters > Distort > Affine) using Equations (Filters > Distort > Equations) instead. I used two parameters which control the horizontal shift and the vertical shift. Here is a photo before applying the macro: and after applying the macro: The horizontal shift was around a half, and the vertical shift about 0.8. Here are the equations: x= irem(x+a*w,w)y= irem(y+b*h,h) As I said, they do not do anything that the Affine Transformation would not do (in a macro), but I offer them here as an alternative which might be more convenient within the context of a more extended procedure. Here is the macro, and the macro library: Macro: Affine Transform.afmacro Library: Affine Transform.afmacros John Dan C and T V 2 Quote Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630 Link to comment Share on other sites More sharing options...
T V Posted April 20, 2020 Share Posted April 20, 2020 Hi John, Try this: fixes the wrap...thanks for introducing me to Affine! - T V x = irem(x+a*h,h) y = irem(y+b*w,w) ⛔ correction...this only works on vertical document format... John Rostron 1 Quote Link to comment Share on other sites More sharing options...
skitchy Posted April 20, 2020 Share Posted April 20, 2020 Thanks Is there any way to process just one RGB channel in the distort equations code? Quote Link to comment Share on other sites More sharing options...
GarryP Posted April 21, 2020 Share Posted April 21, 2020 Use the Channels Panel to switch the channels you don’t want to affect OFF, then perform the Equation Distort. See my attached image where the Red channel has been moved by 100 pixels to the right (Channels Panel settings shown bottom-right). T V and 78deluxe 1 1 Quote Link to comment Share on other sites More sharing options...
John Rostron Posted April 21, 2020 Author Share Posted April 21, 2020 14 hours ago, T V said: Hi John, Try this: fixes the wrap... x = irem(x+a*h,h) y = irem(y+b*w,w) No, that will not work. This shifts the horizontal axis a fraction of the height and the vertical axis a fraction of the width. You try it and see! My original shifts the horizontal axis by a fraction of the width etc. 14 hours ago, T V said: thanks for introducing me to Affine! - T V @T V, I would appreciate any input you might have in performing an Affine Transformation using Procedural Textures. John Quote Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630 Link to comment Share on other sites More sharing options...
T V Posted April 21, 2020 Share Posted April 21, 2020 1 hour ago, John Rostron said: No, that will not work. This shifts the horizontal axis a fraction of the height and the vertical axis a fraction of the width. You try it and see! My original shifts the horizontal axis by a fraction of the width etc. @T V, I would appreciate any input you might have in performing an Affine Transformation using Procedural Textures. John John, Seems that only works correctly if w = h. I would like to be able to create these kind of effects in PT also. Not sure the underlying structure of functioning the x, y. If Equations were a live filter it would be much easier to work with...I will put on my tin foil hat and see if anything come to me. - T V Quote Link to comment Share on other sites More sharing options...
John Rostron Posted April 21, 2020 Author Share Posted April 21, 2020 10 minutes ago, T V said: Seems that only works correctly if w = h. Clearly this is true. You do not actually say what 'that' is. My version or yours? My version works for any values of w or h. John Quote Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630 Link to comment Share on other sites More sharing options...
T V Posted April 21, 2020 Share Posted April 21, 2020 1 hour ago, John Rostron said: Clearly this is true. You do not actually say what 'that' is. My version or yours? My version works for any values of w or h. John Sorry, the macro applied differently to horizontal format and vertical format images for me. By changing the w & h seemed to fix. Quote Link to comment Share on other sites More sharing options...
John Rostron Posted April 21, 2020 Author Share Posted April 21, 2020 1 hour ago, T V said: Sorry, the macro applied differently to horizontal format and vertical format images for me. By changing the w & h seemed to fix. I have just tried my version on a portrait image and it works fine. John Quote Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630 Link to comment Share on other sites More sharing options...
T V Posted April 21, 2020 Share Posted April 21, 2020 3 hours ago, John Rostron said: I have just tried my version on a portrait image and it works fine. John This is what happens on a vertical image...works perfect on horizontal. I am updated to current version, not beta. ????? - T V Quote Link to comment Share on other sites More sharing options...
John Rostron Posted April 22, 2020 Author Share Posted April 22, 2020 I created a portrait image, with the height about twice the width, and it works perfectly for me. John Quote Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630 Link to comment Share on other sites More sharing options...
T V Posted April 22, 2020 Share Posted April 22, 2020 6 hours ago, John Rostron said: I created a portrait image, with the height about twice the width, and it works perfectly for me. John John, I opened a RAW(.cr2) file by chance to try it on the same photo instead of .jpg file and it works. My horiz .jpg and .cr2 no problems. Somehow my .jpg vertical format causes problems. I am at a loss to understand what is happening as this is the first time I have encountered an issue of any kind. Your macro works as it should. Sorry for the confusion...this kind of thing does not help my math foundation... - T V Quote Link to comment Share on other sites More sharing options...
John Rostron Posted April 22, 2020 Author Share Posted April 22, 2020 4 hours ago, T V said: Somehow my .jpg vertical format causes problems I wonder if you cropped your image to the vertical format. If you apply Layer > Rasterise and trim, then it should work OK. John T V 1 Quote Windows 10, Affinity Photo 1.10.5 Designer 1.10.5 and Publisher 1.10.5 (mainly Photo), now ex-Adobe CC CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630 Link to comment Share on other sites More sharing options...
T V Posted April 22, 2020 Share Posted April 22, 2020 1 hour ago, John Rostron said: I wonder if you cropped your image to the vertical format. If you apply Layer > Rasterise and trim, then it should work OK. John It's right out of the flash card. I did try cropping and everything I could think. I usually shoot RAW & .JPG and have the RAW for images I really want to play with and usually just grab the .jpg and go. The camera is a Canon 6d mkII...my brain was telling me to take a couple more days off and everything would fix itself, but, no. I did crop the RAW conversion and no problems...just tried images from D80 and same problem. It is as if the pixel information on the horizontal images is being fooled into starting at a different fixed point throwing the calculation off. Otherwise, life is good my friend! +++ok, rasterize worked. Good call. Here is a new one. Cropped and rasterized to original ratio I have to turn to 1's to get the divisions instead of .5. Why rasterize on vertical format and not on horizontal? Please make some more macros using distortions! I wonder if it is all of the equations or just certain ones that act like that. Is rasterize something to think about when creating a macro? Lots of interesting or not good interesting stuff came out of this...my brain is feeling sort of squishy. 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.