Image with transparent background in Flutter

Viewed 5201

I have image of object with transparent background for my Flutter app. But Flutter shows this image with transparent background, as it is. How do i hide transparent background of the image in Flutter?

1 Answers

The image you are using is not a proper transparent PNG file. It's a JPEG. So, please use a proper transparent PNG file. Here are some difference between a JPEG and PNG:

  • Both support true color or a palette of 16 million colors, PNG also supports 256 color and monochrome images.
  • JPEG uses a lossy algorithm, PNG uses the ubiquitous lossless algorithm which we all know as ZIP.
  • PNG supports alpha as well as single color transparency. JPEGS are opaque.
  • Compression ratio of images can be upto 50x for a JPEG but maybe at most 4:1 in PNGs for most images with many colors
Related