# Layer bounds is incorrect in some situation

**URL:** <https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737>\
**Category:** Photoshop\
**Created:** [October 14, 2021, 2:19am UTC](https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737 "2021-10-14T02:19:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuxiao](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/liuxiao/32/1905_2.png) [@liuxiao](https://forums.creativeclouddeveloper.com/u/liuxiao)\
**Post date:** [October 14, 2021, 2:19am UTC](https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737/1 "2021-10-14T02:19:04Z")

</div>

I got a .psd file from my user, and the bounds of one layer is wrong.

this layer has 1px outside stroke effect, but the `bounds` is not equal to `boundsNoEffects` plus 1px stroke。

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/9/9e5dcac5b944b7327d6315f15706571e7c3922f3.jpeg)

I’m not sure if this is a bug

How Can I get correct bounds with effects? is `bounds` untrustworthy?

by the way: I did not find where to upload attachments to this topic

---

<div class="post-metadata">

**Author:** ![liuxiao](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/liuxiao/32/1905_2.png) [@liuxiao](https://forums.creativeclouddeveloper.com/u/liuxiao)\
**Post date:** [October 14, 2021, 2:31am UTC](https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737/2 "2021-10-14T02:31:55Z")

</div>

this layer is a pixel layer(kind=1)

---

<div class="post-metadata">

**Author:** ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)\
**Post date:** [October 14, 2021, 11:08am UTC](https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737/3 "2021-10-14T11:08:55Z")

</div>

Bounds are always shown in full pixels. However, the stroke effect doesn’t seem to occupy exactly one pixel always - it depends on how soft the edge of your layer is. Here’s an example with two circles that have the same size, but one has a softer edge (semi-transparent pixels):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/e/eb1761a3b4999e1abb88e9eab4fae758effdf5c4.png)

In this example, both layers have a stroke effect of 1px, the one on the left is clearly wider than 1px though.  
Logging the bounds / boundsNoEffects of the left one, I’m getting the same results as you (difference of 3px).

---

<div class="post-metadata">

**Author:** ![liuxiao](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/liuxiao/32/1905_2.png) [@liuxiao](https://forums.creativeclouddeveloper.com/u/liuxiao)\
**Post date:** [December 27, 2021, 9:07am UTC](https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737/4 "2021-12-27T09:07:41Z")

</div>

Thank you Simon, as you say, this seems to be a feature rather than a bug.  
but I still have a little problem.  
can you show me how to create ‘soft edge’ shape and ‘sharp edge’ shape? this allows me to avoid this scenario and give correct tips to my users.

---

<div class="post-metadata">

**Author:** ![simonhenke](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/simonhenke/32/957_2.png) [@simonhenke](https://forums.creativeclouddeveloper.com/u/simonhenke)\
**Post date:** [December 27, 2021, 3:53pm UTC](https://forums.creativeclouddeveloper.com/t/layer-bounds-is-incorrect-in-some-situation/3737/5 "2021-12-27T15:53:38Z")

</div>

That depends on the type of layer or tool you’re using.  
The brush tool is designed to have somewhat soft edges, even if you turn the brush hardness all the way up. All shape tools (for example the ellipsis tool) or the pencil tool will create more sharp results.  
If you’re dealing with an image for example, it can happen to have a soft edge if it has been transformed before. What helps there is to duplicate the layer several times and then merge it into one again.
