You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
move storage type conversion trait from ImageCore to Colors #475
I have no objection to "defining" them in Colors or ColorTypes, but I am not comfortable exporting them. 😕
I can fully understand why you would prefer to have them defined in Colors (or ColorTypes), but I don't see what the trouble is with having them in ImageCore.
The same goes for clamp01 and clamp01nan.(cf. #469 (comment))
Even if we do the migration, I don't see any reason not to fix n0f8(RGB24) etc. in the current ImageCore. (I'm not sure whether n0f8(RGB24) should return RGB{N0f8} or RGB24, though.)
I think it's straightforward to define n0f8 and so on in FixedPointNumbers and implement n0f8(::Colorant) and so on in ColorTypes. However, I'm not sure that it's really a good idea for FixedPointNumbers to provide such non-generic functions.
Also, I don't think float32 and float64 are functions that should be exported by the low-level packages.
However, I think the following should be solved within ColorTypes.
julia>convert(Colorant{Float32}, RGB24(1))
ERROR: nonparametric type RGB24 has ambiguous destination Colorant{Float32, N} where N
Activity
kimikage commentedon May 9, 2021
I have no objection to "defining" them in Colors or ColorTypes, but I am not comfortable exporting them. 😕
I can fully understand why you would prefer to have them defined in Colors (or ColorTypes), but I don't see what the trouble is with having them in ImageCore.
The same goes for
clamp01andclamp01nan.(cf. #469 (comment))kimikage commentedon May 9, 2021
Also, as you know, there is the inconsistency problem with
floatother than forFixedPoint/AbstractFloat.johnnychen94 commentedon May 9, 2021
I'm okay with this since it's mainly the package developer that needs to take care of the storage type.
My main consideration when proposing this move is that I want to give better support for them on broader color types. Currently,
This need arises when I tried to convert all colorant images to N0f8/UInt8 byte sequences:
The only reason that I feel it better to live in Colors is that they are pixel-level operations. 😄
kimikage commentedon May 9, 2021
Even if we do the migration, I don't see any reason not to fix
n0f8(RGB24)etc. in the current ImageCore. (I'm not sure whethern0f8(RGB24)should returnRGB{N0f8}orRGB24, though.)kimikage commentedon May 15, 2021
I think it's straightforward to define
n0f8and so on inFixedPointNumbersand implementn0f8(::Colorant)and so on inColorTypes. However, I'm not sure that it's really a good idea forFixedPointNumbersto provide such non-generic functions.Also, I don't think
float32andfloat64are functions that should be exported by the low-level packages.However, I think the following should be solved within ColorTypes.
(Of course, this is a known issue:
https://github.com/JuliaGraphics/ColorTypes.jl/blob/81297fff41e28dc64ace72a37c090ee22363ba71/test/conversions.jl#L446)
johnnychen94 commentedon May 15, 2021
Makes sense to me; either move or not are good. We can keep this issue open until we decide the 1.0 status.