Coder Social home page Coder Social logo

Comments (2)

kimikage avatar kimikage commented on May 23, 2024

Let us sort out the issue.

First of all, Colors.jl does not provide arithmetic operation methods for colors except XYZ and LMS. (cf. Support arithmetic only for linear color spaces)
So, it seems to me that the inferred return type Union{RGB{Float32}, RGB{Float64}} comes from the codes of ColorVectorSpace.jl.

Second, what is the expected return type of mean(::Array{RGB{N0f8}})?
If you mind the type stability because of the processing speed, I wonder whether RGB{Float64} is always best. Moreover, to stop using mean may be a possible measure.
If the problem is not the speed, why not explicitly convert the result into preferred type? For example,

julia> Test.@inferred convert(eltype(A), mean(A))

By the way, the return type of Colors.weighted_color_mean() is the same as the inputs, i.e. RGB{N0f8} in this case, although it may cause a precision issue.

Well, if it is a pure backward compatibility issue, it's time to give up.
Julia v0.7 (v1.0) includes many breaking changes, you know.

from colors.jl.

timholy avatar timholy commented on May 23, 2024

@Evizero, sorry that I failed to notice this in the crush of updating packages to Julia 1. Fixed over at JuliaGraphics/ColorVectorSpace.jl#103

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.