Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Max scale to Emoji's/Stickers #122

Closed
efalco777 opened this issue Jun 19, 2024 · 7 comments
Closed

[Feature request] Max scale to Emoji's/Stickers #122

efalco777 opened this issue Jun 19, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@efalco777
Copy link

Platforms

Android, iOS

Description

Add max scale to: StickerEditorConfigs & EmojiEditorConfigs.

Why

Would be nice to be able pass an argument to set the max scales for both of those layers. That way we could eliminate scenarios where the set layer is scaled so much it becomes blurry or pixelated.

@efalco777 efalco777 added the enhancement New feature or request label Jun 19, 2024
@efalco777
Copy link
Author

Also is there any way we could increase the resolution of emojis?

@hm21
Copy link
Owner

hm21 commented Jun 19, 2024

Thanks for your feature request.

I released version 4.0.6 where I added the ability that you can set a maximum and minimum scale factor in the configs to every layer type.

The resolution of the emojis depends on your device, in which quality they are available when you use the system default emojis. For the case you want to use emojis in high resolution will I recommend you to use a custom font. An example can you checkout here where I apply GoogleFonts.notoColorEmoji() for high resolution.

@hm21 hm21 closed this as completed Jun 19, 2024
hm21 added a commit that referenced this issue Jun 20, 2024
@efalco777
Copy link
Author

Thanks for your feature request.

I released version 4.0.6 where I added the ability that you can set a maximum and minimum scale factor in the configs to every layer type.

The resolution of the emojis depends on your device, in which quality they are available when you use the system default emojis. For the case you want to use emojis in high resolution will I recommend you to use a custom font. An example can you checkout here where I apply GoogleFonts.notoColorEmoji() for high resolution.

I overlooked that, emojis with this solution look much better. However in the example, opening emoji picker on iOS makes the app unresponsive for 3-5 seconds, could you check? If you'd like i could create a separate issue for this.

@hm21
Copy link
Owner

hm21 commented Jun 20, 2024

Does it happen in the debug mode or also in the release mode? For the case it's in release mode too, can you test if it also freezes when you just open the emoji_picker in a bottom sheet without the image editor? That will help that we know the performance impact is from the pro_image_editor package or directly from the emoji_picker_flutter package.

@efalco777
Copy link
Author

Tested emoji picker & seems like its that package's bug. Created an issue there, but it probably won't get addressed any time soon: Fintasys/emoji_picker_flutter#205. Doesn't matter if it's profile/debug, at least on iOS as I've retested on physical device & simulator.

@hm21
Copy link
Owner

hm21 commented Jun 21, 2024

Okay, good idea that you create a new issue directly in the emoji_picker_flutter package.

But to be honest, I think it will be a big challenge for the package owner to solve this problem. I also saw before on some platforms is a small performance impact when we scroll the emoji. The good thing is that the package owner built the project in such a way that we can edit it very detailed, which helped me to make it a bit better than the original way.

The point is I go deep in this package and know a bit now how it works and as you can see here in the end, it's a normal text widget which renders the emoji.
So, in my opinion, the problem is in the way how Flutter render it which has not a good performance. I found two videos on the web which compare flutter's graphics engine skia with the new one impeller where we can also see in impeller is a small impact (if you want to see it clearly I recommend downloading the video).

So I think we have now only the following options:

  • Hope that the maintainer of emoji_picker_flutter has some other ideas how to speed it up.
  • Wait for a Flutter update where impeller has better performance.
  • Try another emoji-font which has maybe a better performance.
  • Massively reduce the amount of rendered emoji at the same time (will end up with a bad user experience)
  • Convert every emoji to JPEG and render images, which might have better performance. But so many emojis will definitely have a few 100 MB or maybe GB if we want it in high resolution. Alternatively, we can convert them to SVG but this will require to use the package flutter_svg.

@efalco777
Copy link
Author

Thanks for the detailed answer. I guess I'll just keep the scale you've implemented for now in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants