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
Add Display P3 wide gamut colors profile to Flutter (a.k.a. enable 25% more colors in Flutter) #55092
Comments
@brianosman I guess, you know more about this topic. Can you shed some light on it? Thanks, Brian. |
@tomasbaran @brianegan do you have plan on adding Display P3 to Flutter? |
@fredlee12345678 I hope @brianegan will be able to tell us more about this topic or even better I hope he or someone else will be able to implement this feature. I just need that feature in my apps but since I'm just starting with app development—I'm not qualified for implementing it in Flutter. |
But looking at Apple instructions (https://developer.apple.com/videos/play/wwdc2017/821/) it may not be that difficult to implement: |
Hey all -- I seem to have been tagged on this one, but I think I'm the wrong person ^^ |
It seems none follow this issue? |
Wider colors profile should be one of the top priorities. We are in 2022, on devices with screens that are made for rich color presentations. Yet, no matter how great is the design of the app it still looks as soulless as windows 95. |
I agree with @enqvida , I thought "building beautiful UI" was a priority for Flutter.... but colors look ugly with Apple devices. |
I'd also like to add that in general, I feel that optimizing Flutter for usage with mobile devices should take priority over things like windows support. I can't speak for everyone, but I'd imagine that most people using Flutter currently are using it to develop cross platform mobile apps, without particularly caring about desktop. Even if someone wanted to build a desktop app, it would have to have a completely different UI from the corresponding mobile app to deliver a good user experience. With respect to that this issue in particular being a P4 priority feels very inappropriate. Especially since it's almost 2 years old at this point. |
I am personally more invested in flutter from a desktop perspective, but being stuck in legacy color space when P3 support for web is right around the corner is definitely silly. +1 to prioritizing this higher. I only just noticed this when I tried to introduce a box shadow and noticed that it's just as choppy if not more choppy than its web counterpart; really makes subtle lighting and shadow effects difficult to implement well. |
It appears that on macOS Flutter uses Display P3 (even when it shouldn't). See #96733 (comment) |
I really need display P3 for iOS soon. Are there any developments with this issue? |
I can't stand the way colors look on Flutter apps compared to others, when Flutter will make a use of P3 color gamut? Can't wait! |
Here is some information I could gather: ChromiumExample for P3 (works on a Chrome on a Mac): Chromium has already an implementation for the P3 Color Space: Also worth a look: SkiaSkia reads and writes the Color Space in the header. SkImageInfo: contains the SkColorSpace: https://github.com/google/skia/blob/main/src/core/SkColorSpace.cpp FlutterUnsure where Flutter finally draws, but these here look suspicious to me: https://github.com/flutter/engine/blob/main/shell/platform/darwin/ios/ios_surface_software.mm#L62 If we would have somewhere an attribute we can pass through from Flutter, we could exchange the calls here:
with this here (or something configurable actually):
Edit: What about the following:
If I got all this wrong, please let us know what needs to be done or how to approach this. Thanks, |
Our development team has transitioned to flutter because of the speed it allows us to develop for all the platforms we're trying to reach, but with design being such an important part of out product, not being able to use DisplayP3 colors (particularly on iOS) might be a deal breaker for us. I'd like to request the priority of this gets increased due to how drastic the difference between Flutter apps (with sRGB) and native apps (with DisplayP3). Until this is sorted, for us and many other teams, Flutter is not a viable alternative. |
@serena7889 I've seen that you forked the Flutter Engine. Could you get it working? I would be open to invest my time into this and help. My naive approach would be first that I change all the occurrences I mentioned above with Thanks, |
Any plans for this? |
This limitation means Flutter isn't suitable for anything related to exact color (not only images, but also design assets that need to be rendered correctly). Until it's fixed Flutter isn't an option for those cases. |
I'd like to add, that the current slogan on flutter.dev is "Build apps for any screen". I want to do that but I can't. |
Unfortunately most serious tech company will immediately rule flutter out from its tech stack until this is supported. Almost all smartphone displays nowadays support wide gamut color. Has anyone from Flutter even acknowledged this issue yet? Are there any plans in the roadmap to address it? @timsneath |
This comment was marked as off-topic.
This comment was marked as off-topic.
does impeller address/solve this? |
Capturing discussion around this:
This would require work an API to be exposed and used by the framework to specify/grab the color profiles. Whatever pattern works with Skia would also likely work with Impeller, but would need to be implemented either way. |
There is a huge demand by professionals to support the greatest quality a device can handle. Can you re-enable and give developers a switch or declare what color space to use? |
Yes, it's possible this would be opt-in feature (possibly via an Info.plist key) to be plumbed through. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@jmagman I was wondering if there is a timeline on this? Thank you |
No timeline to report. |
P4 is default for bugs that are not currently being worked on, we are aware of its importance. Please see https://github.com/flutter/flutter/wiki/Issue-hygiene#when-will-my-bug-be-fixed for prioritization policies. |
This comment was marked as off-topic.
This comment was marked as off-topic.
hey @serena7889 and @StefanReinDexcom are you making any progress on this? i don't have the low level experience but maybe i can put a few bucks behind it to help expedite? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Please just |
Can someone please help me understand this issue in very layman terms? I am facing something very similar and I did an extensive research on my end, but haven't been able to figure out what exactly happens when the app runs on iOS? Is it something like -> I give a Color code in flutter (0xFF282726) -> iOS converts this to P3 into (R: 0.1569, G: 01529, B: 0.1490) -> (Skia maybe?) Converts it back to sRGB (R: 0.1578, G: 0.1528, B: 0.1485) and this gets displayed on the screen which is a lot more dull than the original color? Apologies for asking such a naive question on this thread, but we had spent more than 3 months in developing the first version of our app in flutter and after coming across this issue, we have to make the painful decision of writing the entire code in native for both iOS and Android for another three months. Please help me understand this, it would be great if I can apply some workaround to this to get the first version rolled out. |
@tomasbaran I just want to set expectations since the description of this issue says "25% more colors" and "Important especially for images." Supporting rendering in a wide gamut colorspace will not give you more colors from images since the file formats supported by Flutter are limited to 8bits per channel. For images in the Display P3 colorspace, you'll just get different colors (correct colors and a higher dynamic range) on the display. For images in the sRGB colorspace they will look the same. What are the images you are trying to render? Are they jpegs in the Display P3 colorspace? What about other colorspaces like Adobe RGB?
Why are you considering an option to add support instead of just doing it all the time? |
Supporting wide gamut comes with an overhead. The backing stores (surface + raster cache) would need wide gamut pixel format (i.e. bgra10_xr_srgb on Apple, which is 64bit per pixel), or separate 32 bit surface for color (10 bit per channel) + 8 bit surface for alpha, which I'm not sure skia supports. So if application doesn't have any wide gamut contents it might be good to be able to opt-out this. Also in case when application is running on device that doesn't support wide-gamut. |
@knopp Skia does support P3. It works on Chrome, which uses Skia. Chromium has an implementation for this. Somewhere up I even showed the LOC where to start from my point of view. **Edit: Sorry, my bad! |
I never questioned whether Skia supports P3, my question was about support separate buffer for color attachment and alpha channel, which would allow doing wide-gamut with 40bits per pixel instead of 64. |
Thanks @knopp, that's a good assessment. I was considering the memory requirements and opt-in in my design doc. I was more fishing for the reporters' expectations. I think there are some misconceptions about what adding Display P3 will do =) |
I've written up a design doc that proposes how to implement this feature in the engine: https://docs.google.com/document/d/17C7UAaLSX2hHOq-hYENeJ1HwMhPCL-e0pb9Pn8rXUok/edit TLDR: Expand the bitrate for render buffers and Display P3 textures to 64bits / pixel iOS and keep the color encoding in linear space. Add support for Display P3 images and smoother gradients, avoid any Dart API changes. |
Flutter Roadmap for 2023 confirmed the interest in implementing wide color gamut support!
|
Hi all! We added a new flag for wide gamut support on master. It would be great to get some testers! You can enable it with this flag. Make sure you're using Impeller and that you're running the app on a real device, not a simulator. Please send me a message on discord (@leighajarett) if you're giving it a try :) |
Great news! I'd like to test it, what version of flutter is it available from? |
flutter/engine#39111 behind the |
Thanks, that's useful. Of course is only an iOS setting, does this release also have support for android devices? |
No, we started with iOS. From https://docs.google.com/document/d/17C7UAaLSX2hHOq-hYENeJ1HwMhPCL-e0pb9Pn8rXUok/edit#heading=h.t6z7bji7vfnm
|
Use case
25% more colors
First off, my app is full of imagery. iPhones (since iPhone 7), iPads, Macs and Android devices have been using Display P3 wide gamut for some years now. It's kinda last century to give users the old sRGB colors, when their phones support the wider P3 gamut that provides 25% larger color space. Important especially for images.
Color discrepancy btw iOS and Android
Second, I'm not sure it's related to the same issue but there is a discrepancy between colors on Android and iOS when running from the same Flutter codebase. More here: #39113
Flutter shall achieve the same quality as the native code
Third, when writing a native iOS app, you can choose which Color Profile you want to write the app in (sRGB/P3). So, when choosing to write a Flutter app (instead of a native one), you are limited and won't achieve the same results. We want to achieve the same in Flutter as in native!
Proposal
Please, add an option to choose which color Profile we want to write Flutter apps, so they truly are beautiful as they are meant be. It is one of the Flutter pillars, right?
More info by Apple, Google
The text was updated successfully, but these errors were encountered: