Investigate conversion of hard-to-replace PNGs to SVG
Almost all graphics in the app are SVG instead of PNG now. There are just a few left that are hard to convert. It may be that some or all of these are impossible to convert, that is unknown and part of the task.
It is certain that this is not a high priority though, as the number of remaining PNGs is so small that any additional compiled app size benefits will be very small.
ankidroid_txt (I have svg format of anki txt if someone wants to try )
drawer_shadow.9
widget_bg_number.9.png
widget_bg_small_finish.png
widget_bg_small.png
widget_bg_time.9.png
Originally posted by @vinishhub in https://github.com/ankidroid/Anki-Android/issues/8707#issuecomment-828659145
@vinishhub - please attach your SVG of ankidroid_txt here if you could? Thank you!
@mikehardy github does not support svg format can i add drive link
@mikehardy github does not support svg format can i add drive link
You can add it to a zip and upload it
ankidroid_txt ->ankidroid_text.zip
@mikehardy what if we convert these images to webp ?
I don't know if that is a big enough difference in compression to matter. I also don't know if webp is supported down to api21 on all devices in all the places?
webp is supported down to api21
https://developer.android.com/guide/topics/media/media-formats#image-formats
When I tried converting widget_bg_small.png this was the result๐๐ผ๐๐ผ

Hmm - that has potential and there are definitely some cases that just can't go svg. If webp works for them, it's worth a try. These are very small savings though, so I would not spend more than a few minutes on it :-)
Hmm - that has potential and there are definitely some cases that just can't go svg. If webp works for them, it's worth a try. These are very small savings though, so I would not spend more than a few minutes on it :-)
one more thing is that we can't convert 9-patch files to Webp
Hello ๐, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically
Hi can I work on this issue as I'm new and want to be accepted in Gsoc, what i have understood that there is some PNGs I have to make them SVGs and then replace them from drawable file
Am I right?
@Ghanem21 :wave: - I had to learn about 9-patch files just now in order to even answer your question - these are worth a read: https://stackoverflow.com/questions/17124719/creating-using-9-patch-images-in-android https://tekeye.uk/android/examples/ui/android-9-patch-image-files
The short answer to this:
what i have understood that there is some PNGs I have to make them SVGs and then replace them from drawable file?
Is this from the description:
It may be that some or all of these are impossible to convert, that is unknown and part of the task.
In other words, I don't know. It appears that webp could maybe work for non-9-patch files, as our minSdkVersion is 21. But for each of the 9-patch files you would need to examine their specific use and see if the special feature of 9-patch - that it is stretchable but with specific stretch and non-stretch areas - is actual a strict requirement for the image. If 9-patch's stretch/non-stretch feature is a requirement for the image, it is impossible to convert the image I think.
@mikehardy okay, then you want me to try change it to 9-Patch or webp depend on it's support 9-patch or not am I right?
That's not what I said, I believe my comment - after re-reading it - is the full description of the task.
I don't know if webp is supported down to api21 on all devices in all the places , I think we can make it patch-9 and let non Patch-9 as png or try to make it from scratch as svg
@mikehardy
I try to make this patch-9 on ankidroid_txt and this is screen in android studio

I don't know if webp is supported down to api21 on all devices in all the places
Documentation seems to indicate it's supported fine: https://developer.android.com/studio/write/convert-webp
I am most interested in an inventory of the 3 patch-9 images that checks to see whether they actually need to be patch-9 (with it's strech/non-stretch area feature) or not.
I tried to make it with widgit_small_small and that what I get is that what are you expected?

also I try to convert patch-9 to webp but it is not supported if there is simple png copy we can make it webp easily
Have I continue in that or try to find another way?
I feel like you are trying technical things without stepping back and thinking about value of the things being done. It's not just a "do this" task, it's a "we need information so we can make decisions task"
This has not been addressed from above:
I am most interested in an inventory of the 3 patch-9 images that checks to see whether they actually need to be patch-9 (with it's strech/non-stretch area feature) or not.
That has nothing to do with trying other things, it's a gather information and give opinions problem.