Photoshop: Resizing unlocked layers creates partially transparent pixels on edges

  • 5
  • Problem
  • Updated 6 years ago
  • Not a Problem
  • (Edited)
When resizing an image, unlocked layers get 1 pixel, half-transparent frame around, instead of solid color throughout (like the locked layers).
Photo of Zeeto VGS

Zeeto VGS

  • 29 Posts
  • 1 Reply Like

Posted 8 years ago

  • 5
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 845 Reply Likes
Official Response
That's not a bug, it's a consequence of having transparent data and using interpolation. When interpolating the new values for pixels, the values of neighboring pixels contribute -- including the transparency values. And, depending on the resampling, you can end up with partial pixel coverage that needs antialiased edges.

Unfortunately, there is no good solution to the issue. It sounds simple when you think about a rectangle, but not so much when you think about a layer that has a flower arrangement with transparency.

If you know you don't want antialiased edges, you can change the resampling method to Nearest Neighbor.
Photo of Zeeto VGS

Zeeto VGS

  • 29 Posts
  • 1 Reply Like
I completly understand what you mean, but I think creating rectangle images (be it sprites or website GUI elements) is so important and common that in my opinion there should be an option (it could be a tick box within Resize Image dialog window) to keep the edges solid.
I can see there is no problem with the edges when the image is "Flattened" - so maybe this tick box could prevent the same behaviour?

Unfortunately Nearest Neighbour doesn't solve the problem as it affects the image appearance.

And am I wrong that in previous version of Photoshop the resizing engine was diferent as I can't renember the images getting half-transparent frame while scaling down?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 845 Reply Likes
Nope, this has been the same as long as Photoshop has had layers (which introduced transparency support). You may not have noticed it before, but it has behaved the same.

And the behavior really can't change as long as you have pixels and transparency.
Photo of Dmitri Medvedev

Dmitri Medvedev

  • 8 Posts
  • 1 Reply Like
This is not true. I have been using photoshop for web development and game development. Resizing textures and images is a very common task. This was not an issue in CS4 and CS5. This is a very big issue for us now with CS6. Please help.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 845 Reply Likes
The issue described here (semi-transparent values on the edges after transforming) is very, very old and not a bug. If you have a different issue, please write up a new topic describing the exact issue you are seeing.
Photo of Dmitri Medvedev

Dmitri Medvedev

  • 8 Posts
  • 1 Reply Like
Thanks for the reply Chris,
As you've said, this is an old issue and we'd love to have it addressed. It would make our lives easier and PS a better product. Thank you.
Photo of Matthew Dunham

Matthew Dunham

  • 1 Post
  • 0 Reply Likes
I've noticed this too, but I am puzzled to as why it happens in a completely rectangle image with no transparency.

Take a look at this image:

It is literally an exact white square on top of an exact black square, yet when I resize I get 1px transparent border? Surely that can't be right, I definitely don't believe that this behaviour has been around forever.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 843 Reply Likes
Please read the previous responses. Yes, that is correct behavior for pixel layers using any interpolation other than nearest neighbor.

Again, the layer has transparency beyond the bounds of the document - the layer contents are not limited by the bounds of the document.
Photo of Zeeto VGS

Zeeto VGS

  • 29 Posts
  • 1 Reply Like
Ok, yes - logicaly it is what should have happend, but I believe there are so many occasions that this is actually very unhelpful, so maybe instead having this topic under "problems" maybe we could put it under the "feature request"?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 843 Reply Likes
You could, but then I'd have to mark it as "mathematical impossibility".

If we resample pixels, then transparency can get mixed in.
The only times we can avoid the resampling is when we know all the details about the shape being resized (ie: it's a vector shape).
As long as pixels are involved, you can end up with transparency due to resampling and antialiasing.
Photo of Zeeto VGS

Zeeto VGS

  • 29 Posts
  • 1 Reply Like
Chris, thanks for your replies.

Yes, indeed it is mathematicaly imposible, however flatten images doesn't get transparent edges on resize, I can see why.

But also I can't see why adding exception to algorythm and prevent 100% transparency on the edge pixels (only when user for example tick the "treat as flatten" on "resize image" dialog window) shouldn't be possible.

Thank you.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 843 Reply Likes
Because Photoshop has no real way of knowing what the edges are. Layers can go outside the document bounds, and other layers are smaller than the document (and other people expect the same miracle of knowledge to occur).
Photo of Patrick Boehner

Patrick Boehner

  • 13 Posts
  • 1 Reply Like
Good rule of thumb, if you can't see it at 100% then it's not there and is most likely an issue of interpolation. There are a lot of small things like that.
Photo of Blake Leftwich

Blake Leftwich

  • 2 Posts
  • 0 Reply Likes
This means a lot of extra work when creating art assets for iOS devices. Instead of being able to resize images to half their size for older devices, I have to remove all blending options (strokes and shadows), resize to half size, add new blending options at half the value of the larger size. This will create hours of extra work for our current project.