Skip to main content
greless
Inspiring
March 20, 2019
Answered

How to get the height of a layer from the layers pannel

  • March 20, 2019
  • 3 replies
  • 2685 views

I found that the height of the layers is different for different canvas sizes,This is a layer height About 41 pixels and width:height=1:1.

The data are irrelevant,oh,I just want to get the layer height,please help me !

    This topic has been closed for replies.
    Correct answer Trevor.Dennis

    yes,That's about what I mean,the hard part is I don't know the rules, and I don't know how to compute it.


    龚亮g64532194  wrote

    yes,That's about what I mean,the hard part is I don't know the rules, and I don't know how to compute it.

    It's straight math.  If the thumbnail is set to Large, and the document is 1000 X 800 pixels, then the layer height will be:

    800 / 1000 =  0.8 so 78 (width in pixels) X 0.8 = 62.4

    You  monitor can't  show fractions of a pixel, so I'm guessing that the thumbnail would be 78 X 62 pixels

    If the document was 800 X  1000  pixels, the thumbnail height is going to be 78 pixels so, in this case, the thumbnail width will be 62 pixels.

    You can test it  using screen shots and pasting into Photoshop.

    Zoom way in so you can see the pixel grid, and drag a selection around the thumbnail.

    The heads  up will  show the pixel size.

    In this case you can see my estimate was one pixel out in one direction, and half a pixel in the other.  I suspect this will be always be repeatable and predictable.

    [EDIT]  I have just realised that you have an Excel screen shot in your first post, so  you could make a very simple worksheet to give you those sizes.

    3 replies

    greless
    grelessAuthor
    Inspiring
    March 20, 2019

    It's maybe only adobe developers know this calculation rule

    JJMack
    Community Expert
    Community Expert
    March 20, 2019

    Even if you know the rules the Layer Palette itself is not fixed will change by some editing of the document features and users have options that they can customize the view for their use of the palette. Thumbnails aspect ratios are the same as the Documents  or Layer bounds aspect ratio aspect ratio if displayed and will be fitted to one of three size area choices and the contents can bet relative to the layers bounds or document canvas.  All of which is changeable  with layer palettes options

    JJMack
    greless
    grelessAuthor
    Inspiring
    March 20, 2019

    the actually,i mean to the height of every layer item in Layer pannel,That's my  result,the layer Item height range is 23~40 pixels

    JJMack
    Community Expert
    Community Expert
    March 20, 2019

    Layers can be any size except for Photoshop Background layer it does not support transparency so it will always be Canvas size.  You can not get the layers size from the layer Palette.  You can get a layers bounds with a Photoshop  script.  From Photoshop's UI you can target a layer in the layers Palette then use ctrl+T free transform to see where the layer bounds are. Free transform bounding box will snap to the layers bounds.  You may nee to zoom way out to see a layer bound when  the layers the has  pixels that are off canvas. The is also information in the tool option bar where the center anchor point relative to the canvas the with and height perhaps an angle.  A layer like a smart object layer can also be warped and distorted and has smart filters.

    A Photoshop script could be programmed to write a text file that list a document current layer names and their current bounds.  These of course can be change they are changeable.  Adobe Photoshop Scripting

    JJMack
    greless
    grelessAuthor
    Inspiring
    March 20, 2019

    thanks ,i doesn't need layer bounds but actual layer height in layer pannel.

    JJMack
    Community Expert
    Community Expert
    March 20, 2019

    Layers can be any size  and shape the layers bounds are rectangular a layer's max width and max height. These can be change with processing. If you transform a layer you change its size its bounds change.  If you add text to a text layer it size changes.  If you paint in an empty area on a layer it bounds may change.  Only a background layer is fixed to the canvas  size and a document canvas size  can be changes using canvas size.

    Photoshop does not display and size information in the layers palette. Size information is in the layers data you can get that information via Photoshop scripting.

    JJMack
    Stephen Marsh
    Community Expert
    Community Expert
    March 20, 2019

    Do you mean for the current document selected layer? Does the layer have content (pixel, text, vector etc)?

    Or do you mean for the actual layers panel interface?

    greless
    grelessAuthor
    Inspiring
    March 20, 2019

    i need the actual layers panel interface,when you create a  new docment setting width and height,the layer pannel is fiexed.

    JJMack
    Community Expert
    Community Expert
    March 20, 2019

    Layer can be any size.

    JJMack