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

Getting position of layers with transparent pixels

$
0
0

I need to calculate the exact position of all levels, but there are some errors in the levels where there are transparent pixels.

Calculating the position in this way:

 

               width = ref.bounds [2] - ref.bounds [0];

               height = ref.bounds [3] - ref.bounds [1];

 

                left = (ref.bounds [2] - width) / ImageWidth;

                top = (ref.bounds [3] - height) / imageheight;

                width = width / ImageWidth;

               height = height / imageheight;

 

Does anyone know how to get the resolution to a level even managing the edges of transparent PNG images, perhaps without managing to calculate the bound?


Viewing all articles
Browse latest Browse all 12244

Trending Articles



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