This is an issue for xamarin.uwp and FFImageLoading
, but it reproduces only in UWP.
The issue with optimized files by Photoshop.
I optimized my images on a server with Photoshop. I exported them with option Smaller File (8-bit) after it I got black color in UWP (ios and android are ok).
When I deleted downsample parameters for CachedImage(FFImageLoading
control) then transparency was back.
Example:
And files before optimization and after it
2
Answers
https://github.com/luberda-molinet/FFImageLoading/wiki/Xamarin.Forms-API
Says that the CachedImage class does not support transparency on iOS or Windows Phone. Perhaps since the article was written iOS support has been added but not yet UWP.
It’s a bug, please make a separate issue on project site. It’s related to this:
8 bit PNG can have no more than 256 colors. A part of the PNG file structure holds pointers to 256 colors and then each pixel in the image gets its color from one of those pointers. Thus each pixel only consumes one bytem its 0-255 value pointing to its color on the palette. On the other hand, a 32 bit PNG is 4 bytes per pixel and each pixel can represent a different ARGB color value.
Pixel Format
// Edit I created it: https://github.com/luberda-molinet/FFImageLoading/issues/986