Giter VIP home page Giter VIP logo

colourful's Issues

Question: CIELab to RGB

Hello,
This isn't a question about Colourful; I am trying to understand some code I have inherited that does conversion from CIELab to RGB after decompressing an JPEG 2000 file. I don't know a lot about colour spaces or colour conversions.

If you have a moment, I'm trying to grok the color_cielab_to_rgb method in
this file:

https://github.com/GrokImageCompression/grok/blob/master/src/bin/common/color.cpp

I am trying to understand the code

if(default_type == 0x44454600) { /* DEF : default */
    rl = 100;
    ra = 170;
    rb = 200;
    ol = 0;
    oa = pow(2, prec1 - 1);
    ob = pow(2, prec2 - 2) +  pow(2, prec2 - 3);
} else {
    rl = row[2];
    ra = row[4];
    rb = row[6];
    ol = row[3];
    oa = row[5];
    ob = row[7];
}

Is the code in the else branch a custom CIELab space, and the code above is based on a standard CIELab space ?

If you have time, interested in knowing your take on this.

Thanks,
Aaron

Conversion to CIELAB doesn't match other converters

Maybe I'm doing something wrong, but when I try a basic RGB -> Lab conversion I'm getting a different answer than other converters out there.

var c1 = Color.FromArgb(0, 255, 0);
var c2 = new RGBColor(c1);
var converter = new ColourfulConverter();
var c4 = converter.ToLab(c2);

This gives me Lab [L=87.82, a=-79.29, b=80.99]

But when I try the same conversion on http://colormine.org/convert/rgb-to-lab I get: L = 87.74, a = -86.18, b = 83.18.

Any idea what I'm doing wrong here?

Thanks,
Mike

ColorConverter class name conflict

ColorConverter class name directly conflicts with System.Drawing.ColorConverter. It might be better to change its name for easier integration.

Support Out of Gamut RGBColor

RGBColor currently enforces values to be 0..1. I would like to work with colors that are outside of the sRGB color gamut but still valid.

Is there a way to do that?

NullReferenceException when using default Color

var defaultColor= default(LinearRGBColor);
var converter = new ColourfulConverter();
var actual = converter.Adapt(defaultColor);

Produces an NRE. This also happens with arrays of LinearRGBColor.

Replicating Photoshop's LAB Mode

Hello,

If you take RGB values (Let's say sRGB) and convert to LAB with D50, do you get exact values like in Photoshop?

Thank You.

[BUG] Convert XYZColor to RGBColor throw an StackOverflowException exception

I use the latest version 2.0.3 in .NETFramework 4.7.2, when convert XYZColor to RGBColor throw an StackOverflowException exception. The exception message 'System.StackOverflowException was unhandled Message: An unhandled exception of type 'System.StackOverflowException' occurred in Colourful.dll'.

Test code:

                // arange
                var input = new XYZColor(0.96422, 1.00000, 0.82521);
                var converter = new ColourfulConverter { WhitePoint = Illuminants.D50, TargetRGBWorkingSpace = RGBWorkingSpaces.sRGB };

                // act
                var output = converter.ToRGB(input);

Unity3D requires .NET version <=4.6

Any chance that the code could be down-ported back to .NET 4.6? Unity requires at most .NET 4.6 and this code utilizes .NET 7 functions like "type pattern matching".
The 'in' and 'readonly' keyword can be left out, "get=>" can easily be rewritten and a throw after a double questionmark is easily fixed, but "type pattern matching" needs some rework.

Maybe add unity support in a separate branch? Would you accept a pull request?I could add some extra's to calculate averages from textures etc...

ColourFulConverter Question

Hello,

I am trying to get the converter working with VB.net but I can't for the life of me figure out what is to go in the new constructor of the ColourfulConverter? Anyone that could help. When I run it like this I get the following error: System.ArgumentOutOfRangeException: 'The maximum value is 1'

Dim input As RGBColor = New RGBColor(Px.R, Px.G, Px.B)
Dim LAB As LabColor
Dim conver = New ColourfulConverter()
LAB = conver.ToLab(input)

Example of processing video frames from video file

Hi there,

Thanks a lot for working on this project. I am trying to process video frames from a Rec2020 ST2084 video file and plot a brightness waveform (Y axis is nits) like I am used to seeing in DaVinci Resolve.

Do you have any end to end example of using your library to access individual frames from a video file?

Thanks!

Build for older .NET versions

One of the features that require .NET 4.5 are IReadOnlyList vectors and matrices. These might be substituted with IList or arrays for older .NET versions. Of course, there might also be more problems.

RGB Result in 0-255

Sorry for this newbie question but;
Is it possible to get the RGB Result in 0-255?
Thanks Lars

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.