PNG White Edges

I regularly create 2D graphics in a separate application (CorelDraw) and export them as png with transparency for SU importing.
The problem is that I get some random white edges (artifacts) around the border of the image in sketchup which makes it look messy.
I’ve tried different export options for the png but can’t seem to eliminate them.
I understand this may be a Corel issue but I thought someone here might have a solution for me as the problem primarily shows up in SU.
Has anyone found a way to avoid these white edges?

I’ve attached a screenshot for reference.
Thanks!
white edges|580x460

Can you share the .skp file and the image you are importing? That would help diagnose the issue.

Maybe changing the transparency setting in Styles to be Nicer

Thanks for the suggestion… I didn’t think of that.
Unfortunately it didn’t fix the issue.

Hi DaveR,
Yes, here’s an example SU file.
Note that the problem is most evident when the PNG has a translucent material behind it.

I use this method to show vinyl graphics on windows, so the translucent material behind is important.

Note that the “nicer” transparency setting helps, but it’s the white lines at the edges I’m trying to eliminate - see attached jpeg.

PNG test.skp (174.8 KB)


Check this discussion:

It’s someone using 3DS Max, and having the same problem with CorelDraw exports. The work around for them was to export as TGA.

I guess Colin is going to get you sorted out but there are some non-transparent pixels at the end of the image below the T. Here I’ve imported the image onto an unpainted face and zoomed in and orbited so you can see them.
Screenshot - 9_8_2021 , 8_28_20 PM

In this case I imported the image as a texture. It seems to look much nicer than imported as an image, apart from those pixels.
Screenshot - 9_8_2021 , 8_30_36 PM

I can’t be sure, but that looks like an artifact from the program that created it. If you’re not on board with using Photoshop, I suppose you could download a trial of Affinity Photo and see if it does a better job?

1 Like

Thanks, something like this might be the go. I agree it’s a CorelDraw problem. I just thought someone here might have discovered a workaraound.
I have a lot of collateral already invested in CorelDraw so ideally an intermediate image exporter would be the best solution.

A potential fix

  • I exploded the image in your PNG test.skp file
  • saved the texture as a PNG file
  • opened the png file in GIMP 2.10.14
  • opted to convert the sRGB color profile
  • exported the image as a new PNG file
  • imported the new PNG into sketchup

The result when the image is in front of a 100% opaque color and Faster Transparency Quality.

The result when the image is in front of a 45% opaque color and Nicer Transparency Quality.

Perhaps you can control the color profile directly in CorelDraw.

That’s really interesting. After a bit of reading I’m pretty sure it’s all about the Alpha channel in the rgb profile. This is where the artifacts are. Im not sure corel draw has the ability to adjust this but I will investigate further.
Thanks for your help.
Mark

I think that the general problem is what is called ‘premultiplied’. Often you are making an image to go against a white or black background, and so PNGs are sometimes exported as premultiplied with white. I don’t have CorelDraw to check if it has premultiply settings, but from what I read it may not have. sWilliams did things to compensate for that, but the export to TGA I suggested may avoid the problem completely.

Try researching the Remove “FRINGE” (DeFringe) feature in Corel Photo-Paint. You might have to tweak the selection depending on wether the fringe happens over a dark or a light background.

Good Luck.

I haven’t used gimp before but I downloaded it to try this solution.
I haven’t been able to reporduce your results as yet. The line remains in the image.

Yes, Since I’m getting a different result than Colin with the TGA export and you’re getting a different result than I with the GIMP PNG export, this must be a minor OpenGL implementation detail that is not standard across video cards (wouldn’t be the first time).

hmm,I opened a pdf export from Layout on my iPad and can still see the lines. Is that what you mean?

I know this bug too. No matter how clean the PNGs are cut-out and exported (I use Photoshop), the semi-transparent parts make trouble when seen in front of a (semi-)transparent element – no matter if it’s a sketchup native generated material with transparencies or another transparent PNG.
You can watch a pre-version of a sketchup designed video here.

All of the trees are cut-outs of photos with face 2 camera attribute. Especially when the trees line-up to the camera you can see this ugly effect: The edges get white highlights and the areas behind the semi-transparent edge pixels cause the (semi-transparent) texture behind to become fully transparent! The glass surfaces show the same bug: If two (semi-)transparent elements are arranged behind each other, the glass material magically disappears. I guess it might be the same problem as discussed above. I use the PNG24 (profile sRGB) format of Photoshop which doesn’t cause transparency problems otherwise.

Look at the background of the house on the left: The upper part of the glass front disappears when shown in front of a semi-transparent tree PNG and a semi-transparent house PNG. All of the trees have this nasty white halo.

1 Like

Try exporting the image from SketchUP at double the resolution without anti-aliasing. It should give a sharper image once imported into your image editor & halving the resolution.

In your style settings, set your transparency quality to Nicer.

Thanks, this looks much better now. In the semi-transparent pixels on the edge to transparency there is nevertheless a mistake – the PNGs behind the one in the front become completely transparent in the “halo” area (which is reduced a lot in this “nicer” mode)