Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Can I translate a layer in fractions of a pixel?

$
0
0

I'm using a script to iron out slight variations of camera position in a sequence of time-lapse images (the camera movement is caused by daily expansion and contraction of the timber wall that the DSLR is bolted onto).  I've motion-tracked the sequence in another program and produced a file of the translations to be applied to each image, expressed as a number of pixels in X and Y, in floating point numbers.

The script reads the file into an array, reads in each image, applies the translation (and a number of other transformations such as cropping and scaling) and writes the image out again.

 

The script works fine, except that Photoshop rounds the translation to the nearest whole pixel before applying it, which is simply not accurate enough to give a stable sequence. I've tested this in a separate script using a test image, and hard-wiring the translation values directly into the function call, and confirmed that it only seems possible to move a raster layer in Photoshop in whole pixels, regardless of whether snap-to-pixel is disabled, and regardless of the zoom level.

 

The workaround is obviously to scale the image up each time - say 5 or 10 times - apply a scaled translation - and then scale it down again - but I thought I'd see if I was being stupid and missing something trivial first!

 

P.S I've tried Auto-align, but with limited success - with changing shadows and sunlight, and moving branches etc, it often gets confused.


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>