Jul 9, 2020 Replies: 11 Cross platform library that loads the new WebP format images. Android natively supports this format so the regular LoadBitmap methods will also work. B4i - If you are using a local builder then download the frameworks and add them to the builder: https://storage.googleapis.com/down...eases/webp/libwebp-1.1.0-ios-framework.tar.gz Implementation is based on @Brandsum code: https://www.b4x.com/android/forum/threads/who-can-help-me-to-create-b4i-library.110896/#post-694480 B4J - Based on: https://github.com/zakgof/webp4j (Apache 2.0 license) Download the additional jars. Note that it is a Windows only library. It will show a warning message in the logs when the first image is loaded. Ignore it. (SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder") If you are using the built-in packager then add this line: Code: #CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, ..\Objects\b4xlibs\Files temp\build\bin\ webp.dll Usage instructions: Code: Dim WebP1 As WebP WebP1.Initialize ImageView1.SetBitmap(WebP1.LoadWebP(File.ReadBytes(File.DirAssets, "1.webp"))) Updates: 1.01 - Fixes an issue with B4J and the standalone packager. Attachments B4J_Additional.zip B4J_Additional.zip 352.4 KB · Views: 1,221 WebP.b4xlib WebP.b4xlib 288.2 KB · Views: 467 Last edited: Feb 12, 2025 Click to expand...
Cross platform library that loads the new WebP format images. Android natively supports this format so the regular LoadBitmap methods will also work. B4i - If you are using a local builder then download the frameworks and add them to the builder: https://storage.googleapis.com/down...eases/webp/libwebp-1.1.0-ios-framework.tar.gz Implementation is based on @Brandsum code: https://www.b4x.com/android/forum/threads/who-can-help-me-to-create-b4i-library.110896/#post-694480 B4J - Based on: https://github.com/zakgof/webp4j (Apache 2.0 license) Download the additional jars. Note that it is a Windows only library. It will show a warning message in the logs when the first image is loaded. Ignore it. (SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder") If you are using the built-in packager then add this line: Code: #CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, ..\Objects\b4xlibs\Files temp\build\bin\ webp.dll Usage instructions: Code: Dim WebP1 As WebP WebP1.Initialize ImageView1.SetBitmap(WebP1.LoadWebP(File.ReadBytes(File.DirAssets, "1.webp"))) Updates: 1.01 - Fixes an issue with B4J and the standalone packager.
ADeveloper Member Licensed User Aug 7, 2020 #2 I hope this tutorial can help beginners to use Webp format and this wonderful library (b4a and b4j):
Ferdari Active Member Licensed User Longtime User Sep 5, 2020 #3 Hi @Erel. i tested the lib and the normal ImageView.bitmap=LoadBitmap() in B4A, none of the two plays an animated WebP, is there any instruction that im missing? I mean if WebP is natively supported by Android it should play an animated webp by default. it does in apps ive seen on the store. Last edited: Sep 5, 2020
Hi @Erel. i tested the lib and the normal ImageView.bitmap=LoadBitmap() in B4A, none of the two plays an animated WebP, is there any instruction that im missing? I mean if WebP is natively supported by Android it should play an animated webp by default. it does in apps ive seen on the store.
Erel B4X founder Staff member Licensed User Longtime User Sep 6, 2020 #4 This library, as well as Android native support, is only for static WebP images.
Ferdari Active Member Licensed User Longtime User Sep 14, 2020 #5 Thanks @Erel, i tried to create a wrapper lib for playing animated webp but can't download the dependencies on Eclipse GitHub - penfeizhou/APNG4Android: Android animation support for APNG & Animated WebP & Gif & Animated AVIF, High performance Android animation support for APNG & Animated WebP & Gif & Animated AVIF, High performance - penfeizhou/APNG4Android github.com This seems a very good lib, can you do for playing animated webp?
Thanks @Erel, i tried to create a wrapper lib for playing animated webp but can't download the dependencies on Eclipse GitHub - penfeizhou/APNG4Android: Android animation support for APNG & Animated WebP & Gif & Animated AVIF, High performance Android animation support for APNG & Animated WebP & Gif & Animated AVIF, High performance - penfeizhou/APNG4Android github.com This seems a very good lib, can you do for playing animated webp?
Pendrush Well-Known Member Licensed User Longtime User Sep 14, 2020 #6 Ferdari said: i tried to create a wrapper lib for playing animated webp but can't download the dependencies on Eclipse Click to expand... Compiled lib (aar) you can download here: Maven Repository: com.github.penfeizhou.android.animation mvnrepository.com
Ferdari said: i tried to create a wrapper lib for playing animated webp but can't download the dependencies on Eclipse Click to expand... Compiled lib (aar) you can download here: Maven Repository: com.github.penfeizhou.android.animation mvnrepository.com
Erel B4X founder Staff member Licensed User Longtime User Sep 14, 2020 #7 Please start a new thread for any discussion not related to this specific cross platform library.
TelKel81 Active Member Licensed User Longtime User Jan 21, 2023 #8 Using Google's cwebp encoder, and then loading the image with this library, I get this kind of alpha issue no matter what switch I use for encoding.
Using Google's cwebp encoder, and then loading the image with this library, I get this kind of alpha issue no matter what switch I use for encoding.
TelKel81 Active Member Licensed User Longtime User Jan 22, 2023 #10 B4J. The alpha channel seems incorrect (inverted + unknown issue).
Erel B4X founder Staff member Licensed User Longtime User Jan 22, 2023 #11 No solution here. Sorry. It looks like a feature that isn't supported by the underlying Java SDK.
Erel B4X founder Staff member Licensed User Longtime User Feb 12, 2025 #12 1.01 - Fixes an issue with B4J and the standalone packager.