Add color space configuration feature#89
Open
ltatarev wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
setColorSpacefunction needed on iOS as a way to configure the color space for image processing.This change was needed to ensure consistency when displaying images with color matrix filters across iOS, Android, and web platforms. Android defaults to sRGB color space, and achieving parity with this behavior was the primary motivation for this implementation.
Changes:
iOS Implementation: Added
setColorSpace()static method toFasterImageViewManagerthat configures the globalCIContext. The initial approach was to passcolorSpaceas a prop, but was unsuccessful becauseCIContextconfiguration must be set globally at initialization rather than per-image. SupportssRGB,displayP3,linearSRGB, andgenericRGBcolor spaces.Android Limitation: Coil 2.4.0 does not expose
ImageLoader.Builder.colorSpace()(available in Coil 3.x), preventing color space configuration at the loader level. Implementation would require a custom decoder component to apply the color space during decoding, which is more complex and less reliable than using the native API. The Android implementation could be revisited if/when upgrading to Coil 3.x.Visual examples from example app show how the update looks on iOS: