Copy link to clipboard
Copied
Hello Everyone,
I've had this issue for a little while now and I can't see to find the solution doing a Google search. If I have an image in Photoshop that I'm finished with and I need to export it as a .png file, I'm often gettting a transparent border that's visiable on the exported file. If I add that image to a webpage, there's a faint grey line visible around the frame. If I bring that same exported .png back into PS and zoom in, there's a visible frame all around the image that looks to have transparent pixels. Those transparent pixels are not present in the original PS file. I'm assuming it's a simple fix, I just can't seem to find it. I do drop the pixel size dimensions a little before exporting the .png. As an example, the original PS file might be 1412 W x 1521 H, and I downsize to 928 W x 1000 H for the .png export.
Has anyone else had this happen, and is there a solution?
I've attached close up screenshots of a white corner area where in the original PS file you can see it's solid white to the edge, but on the exported and then imported .png file, you can see the transparent border. The dark grey area is just the background PS canvas in the screenshot.
If the original isn't flattened, try duplicating the doc and flattening before resizing and or exporting, then close the dupe without saving.
Copy link to clipboard
Copied
If the original isn't flattened, try duplicating the doc and flattening before resizing and or exporting, then close the dupe without saving.
Copy link to clipboard
Copied
The original PS doc was just one layer. It was an old photograph that I cleaned up and restored. So I don't think it's a layering issue. Thank you for the suggestion though.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
If it's a floating layer and not a flattened Background layer, then it's probably edge interpolation.
Copy link to clipboard
Copied
Yes, @Stephen Marsh points to something important: With a floating layer, edge pixels will be interpolated in a resample, resulting in semi-transparent edges.
This is fine if you know about it and can take your precautions, but it can easily catch you by surprise.
Would it be feasible/practical to lock all edge pixels in resampling? Any scenarios where that is not desirable?
Copy link to clipboard
Copied
My original .psd file has no extra or floating layers (see screenshot). It's just a single flattened layer that I save as the .png. Check out my post below about what I found regarding when this is and isn't happening. Might help with someone's solution.
Copy link to clipboard
Copied
It's a single floating layer which has transparency support as an intrinsic property.
It's not a special flattened Background (image) "layer" which doesn't support transparency.
The nuances between the two are important. Critically so in this situation when it comes to canvas edge pixel interpolation.
Copy link to clipboard
Copied
Thank you Stephen. What would I need to do to change that single layer so it's not acting as a floating layer?
Copy link to clipboard
Copied
Thank you Stephen. What would I need to do to change that single layer so it's not acting as a floating layer?
By @Chad 8675309
Flatten the image so that transparency is no longer possible for the single layer.
One can save the transparency as an alpha channel if you think that you may need it again, saving as PSD or another format supporting alpha channels.
Copy link to clipboard
Copied
Thank you! Yes, that did the trick. In my head when people said flatten the image I though they were referring to multiple active layers just being flattened into one layer. As I only had one layer, I thought that was flattened. But I see now that I could right click that one layer and select "Flatten Image" which actually locked the layer and renamed as "Background". I learned something new. Thank you again.
Copy link to clipboard
Copied
Thank you! Yes, that did the trick. In my head when people said flatten the image I though they were referring to multiple active layers just being flattened into one layer.
The English language term for that in Photoshop is "merge".
"Flattening" or "Flatten" has a very specific meaning.
https://helpx.adobe.com/au/photoshop/using/layers.html
As I only had one layer, I thought that was flattened. But I see now that I could right click that one layer and select "Flatten Image" which actually locked the layer and renamed as "Background". I learned something new. Thank you again.
By @Chad 8675309
Now, if you resize the flattened image before exporting as PNG, is your problem solved?
Copy link to clipboard
Copied
Yes. Thank you.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
When you export the PNG, make sure that Transparency is not selected.
Copy link to clipboard
Copied
Maybe this will help with an answer. I'm getting that transparent border only when I adjust the size of the image first (slightly smaller) and then export as a .png. If I then bring that exported .png back into PS, I can see that transparent border. However, if I save the original PS doc as a .png at it's original dimensions, then bring that .png back into PS, there is no transparent border. I can then change the image size of that .png to the slightly smaller scale and save it. Close the doc and then bring it back into PS, and the transparent border is still gone. So the good news is, I have found a work around. However, I'd like to solve this without that second step of having to bring the saved .png at original scale back into PS and then making it smaller. As I'm processing hundreds of images, that doubles the steps needed. This was never an issue in years past, I've only noticed this glitch in the last year or so. Doe sany of that info help for a solution?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now