1 Reply Latest reply on Feb 6, 2014 9:50 AM by EnsilZah

    Statistical center of layer


      Hi, my problem has to do with vertically aligning multiple lines of rasterized text that have ascenders and descenders that throw off the bounding box, example:




      I'm currently aligning them by the center point of the bounding box.

      I was wondering if there's any way to get a better approximation of the desired center point like the average of all the pixels or going line by line of pixels and checking for the point where there is a dropoff in the number of pixels compared to the previous line.

        • 1. Re: Statistical center of layer
          EnsilZah Level 1

          In case anyone is interested, the solution I found is as follows:


          Duplicate layer

          Squash the layer to 1px in width, thus creating an approximation of the density of pixels per line.

          Select the pixels.

          Go into quick mask mode, and use a threshhold depending on the density of pixels I want to discard.

          Use the resulting selection's bounds as a basis for aligning the original layer.