Image corruption when resizing pngs...
#1
This has been a bugbear of mine for as long as I can remember. When XBMC outputs at resolutions other than the one defined in code (1360x768, say, rather than 720p), various images that use transparencies get messed up. For example:

Image

It's a nasty sight. How do I fix it?
Reply
#2
That is nasty. The first thing that springs to mind is that the alpha channel is getting resized and then interpolated, but the image shouldn't be getting resampled at all. The other option is that it make be related to the glBlendFunc. I can't reproduce this though (or at least if it is happening in PM3.HD I can't see it). Can I get a test case?
Reply
#3
Here's a zip with the images shown above. Maybe it's something to do with how PS is saving the PNGs. Try putting them in at the correct resolutions and then changing the display res of XBMC.

http://www.aeonproject.com/dropbin/flags.zip
Reply
#4
It looks like it might be our old friend, the minification aliasing artifact. You might be able to work around it by using images are more opaque, or by using the image control's colordiffuse property.

Option 1) Use opaque images and a diffuse color white with alpha like ccffffff. Your images are accurate colored but you'll have to recreate the assets. They also might not look as good due to jaggies in your source image (from the lack of blur there)

Option 2) Use the as-is with a diffuse color that has full alpha but a color closer to your texture color like ff808080. This will darken your images (whatever the diffuse color value is becomes the max intensity they will be displayed at) but doesn't require any photoshop time.
Reply
#5
I'm curious djh_, is this something you've been able to resolve?
Reply
#6
It isn't, sadly. I tried CapnBry's solutions and they worked to an extent, but there was still some deformation of the images and the dark tones didn't work at all. The only solution I can envisage is having separate folders for common native resolutions like 1080p and 1366x768, avoiding the need for XBMC to resize anything. Maybe you can already do that, but I'm unaware of it working like the old 1080i folder used to.
Reply
#7
This may sound way offbase, but. i remember having an issue with transparent .pngs.

i found there are two ways i made them transparent in PS. one was using layer transparency and the other was filling at the transparency wanted.

one of those worked and one i had issues. i don't remember which was which.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
#8
Well, I think I've sorted it. I needed to clean up all the flags anyway so I tried doing it "raw" in Illustrator using vectors. Exported with the usual Save For Web dialog and they appear to be scaling fine.
Reply

Logout Mark Read Team Forum Stats Members Help
Image corruption when resizing pngs...0