Photoshop - why am I seeing white borders around the image when using Nvidia DDS format?

  • 1
  • Question
  • Updated 4 years ago
  • (Edited)
For some reason Photoshop is adding white annoying borders around the images (at least .dds & .png) I create. Any idea how to turn this "feature" off? I'm using Photoshop for texturing and those white borders are absolutely no go.

Photo of Juha Heiskanen

Juha Heiskanen

  • 4 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 823 Reply Likes
Photoshop doesn't do that. Photoshop saves exactly what was in your document.

Now, there might be a bug in NVidia's DDS plugin - we don't know since that is not our code.

But millions of people are using PNG without any such problem.

So, if you see that problem with PNG, it is more likely to be an error in the application reading the file (possibly incorrect transparency handling).
Photo of Juha Heiskanen

Juha Heiskanen

  • 4 Posts
  • 0 Reply Likes
Hi Chris and thank you for reply!

I used Corel Photopaint before (actually I have used it since Corel Draw 3.0) and I haven't seen this kind of issue before. The Corel X7 license expired two days ago so I finally decided to try Adobe Photoshop.

And sure I can remove the borders in my code when I remove one pixel from every side of the image rectangle but that's not the optimal solution. Actually I already tried that. But I'm not going to make special function just for Photoshop DDS images when I have hundreds of other DDS images already. With CubeMaps this kind of issue is quite fatal.

At very first I saved my images to PNG format in Photoshop and then converted the file to .DDS in Visual Studio 2015 RC. I noticed the white borders right away and I believed the compiler made an error (it's RC anyway). After that I downloaded the nVidia's .dds plugin and the same issue happened with that too.

When I load the converted DDS images in Photoshop I can manually remove the borders. This is best solution I have found for now. And even I make those PNG images in Photoshop I can't see the borders until I convert the images to DDS. I won't believe the both DDS converters VS2015 and nVidia's are broken. I have converted all my previous PNG images from Corel Photopaint to DDS in VS2015 and with Paint.NET and those are still working fine.

It's hard to believe that previous Corel software can make Photoshop to act strange but I'm going to make some registry cleaning. After that I will reinstall the Photoshop.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 815 Reply Likes
It sounds like your DDS code has the problem, again most likely with transparency handling. Photoshop can only write out exactly what you see in your document.

Reinstalling Photoshop is unlikely to make a difference.
Photo of Juha Heiskanen

Juha Heiskanen

  • 4 Posts
  • 0 Reply Likes
Ok, maybe I can do something about it. Thanks again.
Photo of Juha Heiskanen

Juha Heiskanen

  • 4 Posts
  • 0 Reply Likes
Ha! Got it. It looks like Photoshop's default transparent background color is white. In DDS format the background is actually fully visible when it is white and fully transparent when it is black. When I replace the white color with black the background is completely transparent. I can now use the old PNGs with transparent background as template for my new images and then I can convert those to the DDS without any problem!
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 815 Reply Likes
OK, that still indicates a bug in the DDS code -- the color behind something that is fully transparent should not matter or ever be visible in a non-premultiplied image.
Sounds like someone confused PNG with premultiplied color (and PNG is never premultiplied).
Photoshop is also normally not premultiplied, and plugins can specify how they want color/transparency handled (premultiplied, straight, matted with white, etc.).