Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi LMS color space <--> RGB (https://www.delphipraxis.net/169220-lms-color-space-rgb.html)

WojTec 5. Jul 2012 14:29

LMS color space <--> RGB
 
I found this:

Code:
http://en.wikipedia.org/wiki/LMS_color_space
but I don't understand how to use these matrixes to make XYZ from it and then RGB (XYZ <--> RGB I already have). Please F1.

Medium 5. Jul 2012 15:05

AW: LMS color space <--> RGB
 
According to the Wiki, there is not "one" way of transforming, but a multitude. Which one to chose would then depend on the standard you want your operations to adhere to, which seems to be a matter of choice and specific use. Other than that, it's simple matrix-vector multiplication (and inverting a matrix for the reverse transformations).

WojTec 5. Jul 2012 17:26

Re: LMS color space <--> RGB
 
After multiplication 3x3*3x1 I'll get another 3x3 matrix :?:

BUG 5. Jul 2012 17:39

AW: Re: LMS color space <--> RGB
 
Zitat:

Zitat von WojTec (Beitrag 1173703)
After multiplication 3x3*3x1 I'll get another 3x3 matrix :?:

No way :wink: Just do a matrix multiplication.

WojTec 5. Jul 2012 19:31

Re: LMS color space <--> RGB
 
Yes, of course, my mistake ;)

I have this:

Delphi-Quellcode:
var
  L, M, S: Double;
  XYZ: TXYZ;
begin
  XYZ := RGBToXYZ(RGB(130, 113, 222));
  L := (0.4002 * XYZ.X) + (0.7076 * XYZ.Y) + (-0.0808 * XYZ.Z);
  M := (-0.2263 * XYZ.X) + (1.1653 * XYZ.Y) + (0.0457 * XYZ.Z);
  S := (0 * XYZ.X) + (0 * XYZ.Y) + (0.9182 * XYZ.Z);
  ShowMessage(Format('%f %f %f', [L, M, S]));
  // 20,97 22,32 65,95
end;
Now I'll try make reverse transformation. :)

WojTec 6. Jul 2012 10:51

Re: LMS color space <--> RGB
 
I did and it working :D

Just another question, how matrixes from Wikipedia was computed?


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:53 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz