15

I'm not sure what setting or anything has caused this, but when I resize an image in Image > Image Size, the resized image gets semi-transparent 1px border! There seem no obvious settings to cause something like this.

It does'nt seem to do it 100% of the time, I notice it more when I'm cutting up a design and paste images into new documents. Here I have recreated it with a simple 2-layer image:

enter image description here

10 Answers 10

8

This is an artifact of the resampling method.

If you take a 500px square image of red (no other layers and where the red layer is NOT locked as background layer) reduce it to 100px, the transparency is there when using bicubic resampling, but does not happen when using nearest neighbor.

I tried this with noise-filled layers and it still occurs, but is a lot less noticeable.

3
  • It's too bad that nearest neighbor makes the image look like total garbage.
    – manafire
    Commented Dec 12, 2013 at 16:07
  • 1
    It seems to me that this is a bug in the implementation of the resampling algorithm rather than an artifact inherent to the resampling method. I could be mistaken, but if I were to write my own resize algorithm the new pixels would be sampling only from old pixels, and if none of them have any transparency, none should be introduced from the samples. I almost feel as if PS is attempting to sample from beyond the image with edge cases, and getting 0 for opacity/alpha, but that's just total speculation on my part.
    – TMobotron
    Commented Sep 26, 2014 at 23:22
  • +1 For actually giving an explanation instead of just a work-around. Commented Jun 25, 2016 at 0:32
7

I was running into a similar problem but just found a solution, in case anyone finds this useful.

In short, Layers seem to sample from outside the canvas when resized, therefore introducing transparency to the border pixels, but Background Layers don't suffer from this artifact.

You can convert a single Layer to a Background Layer by selecting it and going to Layer > New > Background from Layer or you can convert multiple Layers into a Background Layer by going to Layer > Flatten Image.

Here's what my layer panel looks like before:

Before

And here's what it looks like after:

After

Now I can resize this image and save it out without introducing any transparency.

2
  • Months of this hell; THANK YOU! Commented Dec 10, 2020 at 22:04
  • This is the best solution in my opinion. Thanks!!
    – beeb
    Commented Sep 20, 2022 at 8:00
5

Duplicate the resized layer and merge it down. Repeat. This will remove half-transparent edges of opaque layers. I agree it's a pain in the ass though.

1
  • And while you do that, record it as an action for later use. You never know when you're going to need it again. :)
    – lorddarq
    Commented Sep 26, 2014 at 12:43
4

I have had this a few times, just simply add a layer at the back of the document in a single colour like black, or a colour that matches the edges of your work and should be all sorted!

3

If the photo is important, I combine two images: 1, an image downsampled using the bilinear method, and 2 (on top), the same image reduced using bicubic sharper. That gives me a better photo, with only the edge pixels from the lesser reduction method. (First downsample with the bilinear method, copy the result, then go to history and return to the full-sized image, then downsample using bicubic sharper. To finish, paste the copied first image below the second. Then flatten the image or go to File > Save for web.

And yes, sometimes the result is worth the effort.

2

The best solution I have found for this is to use the old Bilinear sampling method when I need to resize and avoid the 1 pixel semi-transparent border. You can find it under Image > Image Size > Resample: (select Bilinear). It doesn't resample quite as nicely as the Bicubic method, but I find it's good enough and it does solve the problem.

2

Be sure your images is flattened before resizing, the only layer should be the background layer !

2

Try this workaround: say you want a target resolution of 200×100, resize it to ~202×102 instead, and manually remove the semi-transparent border using the Single Row/Column Marquee Tool.

0

I Don't know why it works but I found that converting the item in question to a smart object first then doing the resize (and you can rasterize the layer after if you want) it will not convert semi transparent pixels to grey but preserve the transparency instead. Try it out!

0

My solution isnt that good but I just duplicate the layer a bunch oF times until the borders aren't transparent anymore. simple but does the trick

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.