Coder Social home page Coder Social logo

Comments (7)

rdeits avatar rdeits commented on May 24, 2024

This started happening with ColorTypes v0.6.1 because that version updated gamutmax(::Lab) and gamutmin(::Lab), which caused rand(Lab{Float32}) to start drawing from a larger space, which caused QuartzImageIO to encounter this pre-existing issue.

from colors.jl.

rdeits avatar rdeits commented on May 24, 2024

I suspect the problem is with

function cnvt(::Type{XYZ{T}}, c::Lab, wp::XYZ) where T
returning negative XYZ components for this particular input, but I don't know enough about color spaces to understand what's going on.

from colors.jl.

rdeits avatar rdeits commented on May 24, 2024

From comparison against https://github.com/THEjoezack/ColorMine/blob/master/ColorMine/ColorSpaces/Conversions/LabConverter.cs it appears that Colors.jl uses a default white-point of (0.95, 1.00, 1.08), but that ColorMine uses (95, 100, 108), which makes all of the XYZ results produced by ColorMine 100x larger than those from Colors.jl (but all of the magic constants used in the Lab->XYZ conversion are the same for both libraries). So I suspect the conversion above should be adjusted to reflect the fact that Colors.jl is using a different XYZ gamut than ColorMine

from colors.jl.

rdeits avatar rdeits commented on May 24, 2024

Okay, I finally understand what's going on. That particular Lab value is outside the range that can be represented in RGB (with values between 0 and 1), so information is necessarily lost in the conversion. I will update the QuartzImageIO tests accordingly.

from colors.jl.

KelSolaar avatar KelSolaar commented on May 24, 2024

outside the range that can be represented in RGB

RGB here is sRGB, that value might possibly be encoded by another RGB colourspace with a larger gamut, e.g. Adobe RGB 1998, DCI-P3, BT.2020 or ACES2065-1.

In that particular case it cannot be encoded by ACES2065-1 which encompasses the whole visible spectrum, so it is not a colour :)

sRGB (Linear)       :  [-0.04445121  0.0303619  -0.04719857]
ACES 2065-1 (Linear):  [-0.01621534  0.01624061 -0.03871465]

from colors.jl.

rdeits avatar rdeits commented on May 24, 2024

Ah, cool, thanks! I've still got some catching up to do ;-)

from colors.jl.

timholy avatar timholy commented on May 24, 2024

Thanks for figuring this out!

from colors.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.