Comments (6)
About deprecating dlab
:
People might use it productively in their projects, and npm
et al aren't very supportive about feature migration. IMHO it should at least be maintained as a masquerade so that any unit tests against it stayed green.
The math to get from XYZ to din99c/d is not too hard, it just wasn't easy to find any proper documentation. However, I'm unable to create the reverse math, so (from the culori point of view) any implementation would stay incomplete unless someone else came up with the correct formula.
If it was OK for you I'd just leave this draft PR as it is. If anyone needed din99c/d output they may use it as a base.
from culori.
Hi @rumpelrausch, the latest version of the DIN 6176 standard from 2018 is called Colorimetric determination of colour differences of object colours according to the DIN99o formula.
I was under the impression that DIN99o (the version we implement under the dlab
color space) is the latest iteration of the formula. The paper you linked to is from 2015, so it may refer to an older status quo?
from culori.
That german PDF shows formula for all DIN99 variants, but does not mention the formula for DIN99o / DIN 6176.
I have no access to the DIN99o formula description; It might just implement DIN99b.
Looking at the culori source code for convertLab65ToDlch
it seems to implement DIN99b.
Coming from the wikipedia description and those from the german PDF the DIN99c/d are the formula we're looking for, regardless whether DIN99o actually contains them. The major trick is the the calculation of a different Lab with modified X value. That's not what culori does.
The easiest way to find out whether it's the "blue adapted" versions is looking at the "L" or "f" calculation. Culori definitely does DIN99b and features no "intermediate adapted Lab".
Still trying to get my hands on the DIN PDF, though...
Ah, according to https://de.wikipedia.org/wiki/DIN99-Farbraum DIN99o implements the DIN99b formula.
from culori.
Here's another doc that might shed some light:
https://repository.rit.edu/cgi/viewcontent.cgi?article=5577&context=theses
Chapter 2.4.5 explains:
DIN99o is the latest modification on DIN99 color space [Witt, 2009]. DIN99o has
a similar form as DIN99b, but a parametric factor was added to the lightness channel for
future use in compensating for differences between different datasets.
These factors, kE
and kCH
, are fixed to 1 in culori, so it's identical to DIN99b.
A series of modifications were made on the DIN99 color space in 2002 and
named as DIN99b, DIN99c and DIN99d [Cui, 2002]. Among them, DIN99d has the best
performance and is shown in Equations (2.40) – (2.49). In the DIN99d formula,
tristimulus values X was modified by subtracting a portion of Z to improve the
performance in the blue area [Kuehni, 1999]. A different degree of rotation to DIN99
was applied in the new color space DIN99d.
So, DIN99o lacks the bluish adaptions from DIN99d. Sadly DIN99c/d never got much public attention, even though in most of the papers it's said to provide the best performance, closest to CIEDE2000. A chance to be ahead of things... ;-)
I forked culori and started experimenting with two additional color spaces, d99c and d99d. It works but leaves some questions and todos. If it's OK I'll create a draft pull request.
from culori.
Thank you for the pointers!
For a web library such as Culori, the main reticence to adding color spaces is the increase in bundle size. Although in our case the tree-shakeable entry point can alleviate the issue, most people will use the default entry point, so it’s worth weighing how exotic a color space is vs. the cost it incurs to figure out if it belongs in the core library.
It appears it’s mostly DIN99d that gets mentioned in several papers:
- Analysis of Three Euclidean Color-Difference Formulas for Predicting the Average RIT-DuPont Color-Difference Ellipsoids
- Color difference formula and uniform color space modeling and evaluation - Color difference formula and uniform color space modeling and eva.pdf
- A comprehensive test of colour‐difference formulae and uniform colour spaces using available visual datasets - Luo - 2023 - Color Research & Application - Wiley Online Library
…so I suggest for now we limit ourselves to the Cartesian and polar versions of this color space and defer for now the DIN99c-based ones.
When I added DIN99o, I used dlab
and dlch
without regards to the other, related formulas, so they’re now a bit tricky to fit in… I suggest the identifiers din99dlab
and din99dlch
. (And, in a future major version bump, maybe we deprecate dlab
in favor of d99olab
?)
If you’re okay with the plan, I’ll provide further feedback on the PR you opened.
from culori.
Sorry for the late response. I’ll try to provide the reverse transforms.
from culori.
Related Issues (20)
- culori.d.ts - Is there an updated type declaration file to use with TypeScript? HOT 1
- Implement parse-time clamping of L lab/oklab/lch/oklch
- XYB: is the Chroma from Luma adjustment correction really in the JXL implementation? HOT 2
- Interpolator throwing a NaN/undefined HOT 4
- Library-wide handling of missing and powerless components HOT 2
- Endless loop when using a double point HOT 2
- Add RYB colors HOT 19
- mix() function, and 2d/3d counterparts
- Dead link in docs HOT 1
- Precise chroma clamping in P3 color space HOT 2
- Suggestion to specify target gamut for clampChroma() HOT 1
- Provide ability to tree-shake parsers. HOT 2
- Adjust <number> parsing in HSL / HWB / etc(?) modern syntaxes to appropriate component ranges
- `'culori/fn'` regression in 4.0 HOT 3
- Switch tests from `tape` to native Node test runner
- Addition of CMYK color space HOT 1
- bug: add missing exports for blerp and trilerp HOT 3
- Target not equal to source when converting rgb(1,1,1) to oklch, and then back to rgb. HOT 2
- Consider updating Oklab matrices for better round-tripping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from culori.