Skip to content

Add support for WebP #9857

Description

@Solido

Hi flutter team,

During my testing phase I discovered that using NetworkImage

  • WebP is not supported currently
  • Animated gif will only display the first frame (already great)

Can it be in public documentation and maybe have a follow up ?

In a UI having animated gif and control on the loop is really a great feature,
look at facebook reaction buttons as an example.

WebP because I was expecting to convert all my users upload to this format
but the lack of this feature currently will move the priority. Others may be happy
to read it in the doc.

Regards,

Activity

  1. changed the title [-]Documentation about image format WebP Image format[/-] [+]Documentation about image format WebP/ Gif Image format[/+] on May 6, 2017
  2. abarth commented on May 6, 2017

    @abarth
    Contributor

    Supporting animated GIFs is #204

    Adding WebP is just a binary-size trade-off. We should measure how much binary size it costs to evaluate the trade-off.

  3. changed the title [-]Documentation about image format WebP/ Gif Image format[/-] [+]Add support for WebP[/+] on May 6, 2017
  4. added
    c: new featureNothing broken; request for a new capability
    engineflutter/engine related. See also e: labels.
    on May 6, 2017
  5. Solido commented on May 6, 2017

    @Solido
    Author

    Thanks for considering this feature. Since Flutter is mobile first currently and comparing the size of an animated Gif to an animated webp : http://www.androidpolice.com/2017/05/01/animated-png-format-compare-animated-webp-gif

    Size benefits are really huge for animated webp but maybe not that much with still images.

    Consideration of the benefits should also include the gain of internet bandwith in highly graphical context not only for application first load size. In my case if Flutter support webp it can also drive my server cost to go much lower.

  6. sethladd commented on May 6, 2017

    @sethladd
    Contributor

    Thanks for the feedback! We're curious how much our engine size will grow if we add support for WebP. But I personally agree, WebP is a useful format for when load times and bandwidth costs are important.

  7. FaisalAbid commented on May 6, 2017

    @FaisalAbid

    Since the last few versions of Android Studio, there is an option to convert all your assets to WebP which I'm sure many do to save up room in their apk (as I have).

    WebP while not a blocker could be a barrier for someone porting their app over since they have to get all their assets back to png/jpg

  8. Solido commented on May 6, 2017

    @Solido
    Author

    In my case app users are generating all the content and I'd like to encode it as webP/webM as the results is 30/40 % gains in the size/cost. Same problem than Google+.

    I may not represent the majority of use cases and I understand that engine size is top priority for speed.

    It can be totally acceptable for me to have it as an engine plugin in the rendering core that I have to declare somewhere if the architecture permit this.

    Thanks you for handling this case ;)

  9. eseidelGoogle commented on May 8, 2017

    @eseidelGoogle
    Contributor

    We intend to support video through our plugin system: #2319, once that's done, presumably it should also be possible to wire up video-like things, possibly even additional image decoders like webp through a similar means. But that will mean the plugin may (or may not) contain a webp decoder, which means your app would contains such, and may negate some of the binary size gains you hope to achieve through webp, not sure.

  10. Solido commented on May 8, 2017

    @Solido
    Author

    Thanks Eric, I just want to make clear that the gain is on the server side. If I got several thousands of users uploading medias by encoding to webP/M I'll gain ~30% size/costs compared to storing using jpg, png, etc on many gigs.

    It's more than acceptable to paid let's say 5mo in app size and have the codec saves me bandwidth and storage (A LOT). I got those medias by new Image.network not by bundling assets.

  11. sethladd commented on May 8, 2017

    @sethladd
    Contributor

    I want to also point out that the Android docs recommend using WebP to reduce the size of your APK: https://developer.android.com/topic/performance/reduce-apk-size.html

  12. abarth commented on May 8, 2017

    @abarth
    Contributor

    To gather data about how much this will increase the size of the engine, we need to:

    1. Flip this flag: https://github.com/flutter/engine/blob/master/tools/gn#L66
    2. Drop https://chromium.googlesource.com/webm/libwebp into //third_party/webp
    3. See how much the minimal app size benchmark regresses.
  13. chinmaygarde commented on May 11, 2017

    @chinmaygarde
    Contributor

    The currently wired up decoders are JPEG, PNG, GIF, ICO, BMP and WBMP.

  14. 7 remaining items

  15. FaisalAbid commented on Nov 14, 2017

    @FaisalAbid
  16. sethladd commented on Nov 14, 2017

    @sethladd
    Contributor

    Is it worth estimate what we'd save by removing BMP and ICO? (presumably, those could be implemented in Dart code if someone really needed them?)

    Thanks @amirh !

  17. sethladd commented on Nov 16, 2017

    @sethladd
    Contributor

    Thanks!

  18. amirh commented on Nov 16, 2017

    @amirh
    Contributor

    Note that this will only be available in master after an engine roll (should happen in the next few hours)

  19. FaisalAbid commented on Nov 16, 2017

    @FaisalAbid
  20. amirh commented on Nov 16, 2017

    @amirh
    Contributor

    Engine rolled with WebP support.
    The basic material app size benchmark went up by 159k for Android, 184k for iOS.

  21. imranaalam commented on Oct 26, 2018

    @imranaalam

    How to compare progressive jpeg with webp? Instagram is doing progressive jpeg. In respect of data and processing comparisons.

  22. giaur500 commented on Sep 25, 2020

    @giaur500

    Webp on Android, added as asset works without any problems. Please clarify, will it work on iOS or not? Official documentation does not say anything about it, it only says webp assets are supported in Flutter. Will iOS be able to display webp asset or not?

  23. fzyzcjy commented on Dec 31, 2020

    @fzyzcjy
    Contributor

    @giaur500 Do you find the answer?

  24. giaur500 commented on Dec 31, 2020

    @giaur500

    It seems webp assets work just fine on iOS.

  25. vernalclareai commented on Jan 26, 2021

    @vernalclareai

    Hi, which version of flutter did support the webp format for ios?
    thanks.

  26. vernalclareai commented on Jan 26, 2021

    @vernalclareai

    I wanted to save webp image to gallery on flutter.
    but failed.
    any solution on it?

  27. github-actions commented on Aug 6, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  28. locked as resolved and limited conversation to collaborators on Aug 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilitycustomer: alibabaengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions