T8RIN / ImageToolbox

🖼️ Image Toolbox is a powerful app for advanced image manipulation. It offers dozens of features, from basic tools like crop and draw to filters, OCR, and a wide range of image processing options
Apache License 2.0
4.01k stars 188 forks source link

adding text and/or emojis on images #568

Closed idontveapc closed 9 months ago

idontveapc commented 11 months ago

app has a fair amount of options that an image editor would have, except one i mentioned as the title!

T8RIN commented 11 months ago

Yup, thanks for the suggestion, this planned and mentioned in #461 :)

hushenghao commented 11 months ago

Consider switching from SVG emoji to emoji text in Android 13 and above, as you can use the COLR feature to display clearer emojis.

I can provide some help on whether the system fonts support the COLR feature, because OEMs may negatively optimize emoji fonts on Android13 devices. (Such as : Meizu) COLRv1.kt

T8RIN commented 11 months ago

Consider switching from SVG emoji to emoji text in Android 13 and above, as you can use the COLR feature to display clearer emojis.

I can provide some help on whether the system fonts support the COLR feature, because OEMs may negatively optimize emoji fonts on Android13 devices. (Such as : Meizu) COLRv1.kt

Initially i used emojis as text, that worked great, but on each device that looked different, so i considered switching for svg, so on all devices it'll look the same :)

hushenghao commented 11 months ago

Consider switching from SVG emoji to emoji text in Android 13 and above, as you can use the COLR feature to display clearer emojis. I can provide some help on whether the system fonts support the COLR feature, because OEMs may negatively optimize emoji fonts on Android13 devices. (Such as : Meizu) COLRv1.kt

Initially i used emojis as text, that worked great, but on each device that looked different, so i considered switching for svg, so on all devices it'll look the same :)

It may occur on devices below Android 13, because the system only supports bitmap emoji fonts, and Android 13 and later will support vector emoji fonts. Vector emojis are used in the source code of Android 13 Easter Egg, and drawText is obviously more efficient. Can use lower version downgrade scheme: Android 13 uses emoji text, supporting all emoji; The previous system still used SVG emoji. Minimize differences between different systems.

T8RIN commented 11 months ago

But they will be still different depending on device isn't it? Also didn't the app size will be increased of storing all entire available emojis?

T8RIN commented 11 months ago

Also i have some svgs that are not from emojis👀

hushenghao commented 11 months ago

But they will be still different depending on device isn't it? Also didn't the app size will be increased of storing all entire available emojis?

If using SVG emoji, it definitely cannot support all emojis, so only enable more emoji support or allow users to customize input on Android 13 or above.

hushenghao commented 11 months ago

Also i have some svgs that are not from emojis👀

Regarding custom non-emoji svg, the emoji data structure can be enhanced to support multiple types

hushenghao commented 11 months ago

You can consider allowing users to customize emoji input on Android 13 devices, which will minimally intrude on existing functions.

T8RIN commented 11 months ago

You can consider allowing users to customize emoji input on Android 13 devices, which will minimally intrude on existing functions.

Maybe, but it seems to be tricky, maybe when adding text to images I'll add this, but now i'll need to rewrite all emoji parts to achieve using colr

T8RIN commented 11 months ago

So maybe in the future, not now :)

hushenghao commented 11 months ago

I don't quite understand why assets svg should be copied to the local directory and then loaded. Are there any advantages to doing this?

private fun Context.getFileFromAssets(cat: String, filename: String): Uri =
    "file:///android_asset/svg/${cat}/${filename}".toUri()
T8RIN commented 11 months ago

I don't quite understand why assets svg should be copied to the local directory and then loaded. Are there any advantages to doing this?

private fun Context.getFileFromAssets(cat: String, filename: String): Uri =
    "file:///android_asset/svg/${cat}/${filename}".toUri()

how can I load image without it? Can coil load that directly? If you know, I'll be glad :)

hushenghao commented 11 months ago

I don't quite understand why assets svg should be copied to the local directory and then loaded. Are there any advantages to doing this?

private fun Context.getFileFromAssets(cat: String, filename: String): Uri =
    "file:///android_asset/svg/${cat}/${filename}".toUri()

how can I load image without it? Can coil load that directly? If you know, I'll be glad :)

I will submit a PR to implement this optimization https://github.com/T8RIN/ImageToolbox/pull/581

T8RIN commented 11 months ago

thanks!

T8RIN commented 9 months ago

now you can use watermark feature to achieve this, hope it fits :)