Search the Community
Showing results for tags 'record macro'.
Found 2 results
I have a telescope and can photograph any number of nearly identical images in rapid succession. In each successive image the object I'm interested in may occupy only a few percent down to much less than one percent of the total image, in essence, a sub-image. Because of earth rotation and possible object movement through space, the desired object and sub-images may slowly drift and rotate across successive images. I want to use some or all of these sub-images in Affinity Photo to obtain an enhanced image of the object. The source and sub-images may also be captured and processed in RAW or DNG format, or similar high resolution formats that Affinity Photo can handle. The following is my idea of how this might be automated, possibly by programming and/or recording macros. I'll use a moon image as an example, but hopefully the process will apply to any object that does not distort as it translates and rotates, almost imperceptibly in successive images. The moon is about 382,000 km away, and its movement is nearly imperceptible to the naked eye. However, it can be seen to drift ever so slightly across successive digital images, but its size and shape remain constant. Because of such large distances, virtually everything observed in space does not distort but may slowly translate and rotate in successive images. Affinity Photo can easily handle these linear type image situations. It is well known that noisy, repetitive, linear signals can be greatly enhanced by linear averaging, if the noise is random. Small, clipped images from space, taken in rapid succession and aligned, act like noisy, repetitive, linear signals, and the resolution can also be greatly enhanced by averaging. But not all of the noise is random, pixelation being the main non-random noise component. I'll suggest how one might apply image interpolation at the right time to filter out pixelation noise without significantly degrading final image resolution. I would start by teaching Affinity Photo what object I want it to find by manually clipping out a sub-image from one image, intentionally leaving a small amount of space around the object on all four sides. Using this sub-image as a template, Affinity Photo would then locate and clip out that same sub-image in all other images. In the process it would align all sub-images, similar to what is done in the "New Focus Merge..." macro. At this point I could have Affinity Photo average the aligned sub-images into one final image, but that final image would look very pixelated when exported and expanded. I want to reverse the process. Let me instruct Affinity Photo to interpolate (by any one of its five methods) all clipped and aligned sub-images by #X where # is any reasonable number greater than one, such as 8 or 6.3. The larger the number the better, except that memory usage and processing time must be considered. Now, apply the averaging process to the magnified sub-images to obtain the final enhanced image. If Affinity Photo were instructed to generate many sub-images and expand them by interpolation, and there was no reason to save them for later use, then there would be no need to store all of them in memory during the averaging process. Exact averaging can be done by what I'll call the alpha or A method. Suppose I have five numbers, 3, 15, 27, 9, and 21 that average to 15, and suppose that the first four numbers have been averaged to 13.5. Now I want to use the A method to average 21 in with this previous average of 13.5 to get the final exact average 15. Let N=5, the total number of items averaged in this step. Then let A = 1/N and the new average is obtained from (1-A)*13.5 + A*21 = (4/5)*13.5 + (1/5)*21 = 15. This exact averaging method has two advantages: only two interpolated images have to be kept in memory at any time (the desired final image and the latest interpolated sub-image to be averaged in) and potential overflow associated with adding together many positive numbers and dividing is avoided. Furthermore, much higher precision RAW images could be used and the averaging accumulation process could be performed without losing anything until the final export process. Based on this progressive alpha averaging method, the process might even be made much better. Suppose I have captured 1000 images and have made them available to Affinity Photo in a single sub-directory. Do I need to tell Affinity Photo to process all 1000 of them or could I just let it run, generating and averaging in interpolated sub-image after interpolated sub-image until virtually no further final image enhancement is detected? Or maybe until I instruct it to stop because the zoomed-in, enhanced final image looks good enough to me or I can't detect any further improvements? Also, because Affinity Photo is now processing one interpolated sub-image at a time and accumulating a higher resolution average with each new interpolated sub-image, is it possible that this always up-to-date, high-resolution, running average image would make a better template for locating, transforming, and clipping the next successive sub-image? I think always using the most recent average as template may minimize drift biases. I would like to learn how to generate and record macros in Affinity Photo to carry out these processes or see it implemented as another Affinity Photo feature like "New HiRes Avg..." or something similar. Is this feasible and what are the next steps? What I described above doesn't look entirely like a "recording macros" process but getting down to the programming level. I have many years of programming experience in Fortran and C and less in Python, but I don't know what's used in Affinity Photo. I'm definitely not qualified to program Affinity Photo but I could work with others to help get this job done.