How to Implement Image Compression On Android

  Рет қаралды 8,905

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 25
@leanngugi
@leanngugi 2 ай бұрын
If I wasn't poor I'd buy your courses. Thanks for the things you give us for free.
@lg.studio
@lg.studio 2 ай бұрын
Earlier this year did a similar thing in my the I was working on, but my solution was to also down-scale it to a limited max 1600px (longer edge), as the project allowed to use smaller resolution images for the given purpose. As many new phones make too high resolution images for many purposes, down-scaling worked much better for me.
@Alexmez
@Alexmez 2 ай бұрын
Best android mentor and teacher, 💯💯💯
@clementjoymasinamela4244
@clementjoymasinamela4244 2 ай бұрын
Very useful tutorial, thanks. Can you please do a tutorial on video compression.
@vengateshm2122
@vengateshm2122 Ай бұрын
Can we add ensureActive() immediately after withContext block or it should be below suspending function?
@sijanneupane
@sijanneupane Ай бұрын
done and dusted! ❤
@tarsilacostalonga
@tarsilacostalonga 2 ай бұрын
Great one! Thanks ❤
@gauravkumar-bs3pf
@gauravkumar-bs3pf Ай бұрын
I love learning with you, thanks for this! I just wanted to ask, do you have any tutorial on Speech to Text in Android?
@esekaemmanuel7295
@esekaemmanuel7295 2 ай бұрын
Thank you ❤
@subbubiruduraju9454
@subbubiruduraju9454 Ай бұрын
As different images have different clarity, How can we determine quality and total compressed bytes beforehand to avoid blurred images? Or know if the image can still be compressed more?
@bkshows9141
@bkshows9141 Ай бұрын
Sir , I new in android jetpack compose if you add compress image show after selecting in this video then very thank of you
@anudeepananth
@anudeepananth 2 ай бұрын
Can you please plz post more Compose Multiplatform videos
@pawandeepsingh6365
@pawandeepsingh6365 Ай бұрын
Hey Philipp, Could you please make a video how to navigate back from a page to previous page, by swiping left to right, current page shifts left to right revealing previous page below? Please
@berlinisaiah6892
@berlinisaiah6892 2 ай бұрын
Thank you very much
@natanell777
@natanell777 2 ай бұрын
Why are you using remember in MainActivity? It’s not like a counter where the value can change. How can recomposition happen here?
@ОлексійКондрашов-ю3и
@ОлексійКондрашов-ю3и 2 ай бұрын
Compressing in loop leads to OutOfMemory and not the best solution obviously. Trying to compress images with more than 20-30 mb leads to app crash
@PhilippLackner
@PhilippLackner 2 ай бұрын
The app compressed 20MB images for me without any issues. Since the loop uses a new stream with each iteration, the previous one can be freed up. Therefore, there are allocations for the input byte array, the bitmap and the currently compressed byte array which even for a 20MB image is 50-60MB in memory allocations and is not a lot given what modern devices have as RAM.
@ОлексійКондрашов-ю3и
@ОлексійКондрашов-ю3и 2 ай бұрын
​@@PhilippLackner ​ 20 mb is a compressed image, but when processing it converts to uncompressed bitmap that could take more than 1gb of RAM depends on resolution. Images in Android are displayed with ARGB888 with 4 bytes for 1 px. if we have image resolution 20000x20000 ( I really have one, it is space photo) Bitmap from this image has 1.5 GB size. I checked just know - if I open default image in MS Paint - it take 100-140 mb of RAM (In Task Manager) But if i open the large one - it takes 3.6 GB of RAM. The same happens when you just loading and compressing image in loop but several times! I understand that this case with 20000x20000 image is super rare, but if you develop serious apps with many active users your app will crash if try to load this image. The only workaround is to use BitmapOptions.inSampleSize and already load much more smaller image. For example Telegram compresses all images to fixed 1280px by the larger side. And Telegram doesnt crash when trying to load this image. But if use "loop" approach - it will crash 100%
@shubhamkokatnur6994
@shubhamkokatnur6994 2 ай бұрын
is this possible in java also?
@John-qt6qk
@John-qt6qk 2 ай бұрын
Thanks
@DanishShahzad-us6he
@DanishShahzad-us6he Ай бұрын
What about the video compression
@topwings2836
@topwings2836 Ай бұрын
Course price is 9900€ then as per india Rs.832369 ruphee,Pls someone calrify me
@ka61er
@ka61er 2 ай бұрын
😂
FULL Guide to Kotlin's Inline Keyword (inline, crossinline & noinline)
16:35
How PNG Works: Compromising Speed for Quality
32:00
Reducible
Рет қаралды 642 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
The ONLY Correct Way to Load Initial Data In Your Android App?
12:27
Philipp Lackner
Рет қаралды 40 М.
Gestures in Jetpack Compose
31:33
Android Developers
Рет қаралды 25 М.
Awesome Frontend Libraries and AI
35:28
Know It Today
Рет қаралды 84
This Is My FAVORITE Error Handling Class
28:57
Philipp Lackner
Рет қаралды 35 М.
5 Kotlin Coroutine Secrets I Wish I Knew Earlier
24:23
Philipp Lackner
Рет қаралды 23 М.
The Ultimate Beginner's Roadmap to Android App Architecture
14:58
Philipp Lackner
Рет қаралды 15 М.
Studio Jewelry - Android Developers Backstage
50:38
Android Developers
Рет қаралды 4,5 М.
File Uploads in React (Complete Tutorial)
25:31
Cosden Solutions
Рет қаралды 15 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН