Board index » delphi » Fast way to modify hue, sat, lum of RGB bitmap
Rolf Hansen
![]() Delphi Developer |
Sat, 04 Dec 2004 16:11:18 GMT
|
Rolf Hansen
![]() Delphi Developer |
Sat, 04 Dec 2004 16:11:18 GMT
Fast way to modify hue, sat, lum of RGB bitmap
Hello,
does anybody know a fast way to modify the hue, sat and lum of a rgb bitmap? I hope there exists a better formula to modify the HSL values of a RGB value get RGB values from Scanline Does anybody have a better way to do this? A fast specialized lookup table? thank you, Rolf |
David J Taylo
![]() Delphi Developer |
Sat, 04 Dec 2004 17:57:30 GMT
Re:Fast way to modify hue, sat, lum of RGB bitmapRolf, Not sure if it would be faster, but you could certainly set up an 8 x 8 x One other possibility to speed setting up the table might be to only Cheers, Quote"Rolf Hansen" <rolfnos...@nospambitspaper.de> wrote in message Quote> Hello, |
Nils
![]() Delphi Developer |
Sun, 05 Dec 2004 07:50:27 GMT
Re:Fast way to modify hue, sat, lum of RGB bitmap[sorry if this post appears twice, doesn't seem to appear first time] Just a matrix to convert from RGB to HSL will do fine. If you use floating Lookup tables worked fine in the old days, but nowadays that's not true Perhaps you can find an algorithm that does a matrix multiply in assembler, It would have to do something like var Since there's some alignment in it, in theory this could be made blazingly Whenever you need the HSL rounded results you just round the values to I could give you more info on the conversion matrix, but please try to find Kind regards, Nils Haeck QuoteRolf Hansen <rolfnos...@nospambitspaper.de> wrote in message Quote> Hello, |
Nils
![]() Delphi Developer |
Sun, 05 Dec 2004 07:49:03 GMT
Re:Fast way to modify hue, sat, lum of RGB bitmapJust a matrix to convert from RGB to HSL will do fine. If you use floating point arithmic this is supposedly faster than integer arithmic these days. Lookup tables worked fine in the old days, but nowadays that's not true Perhaps you can find an algorithm that does a matrix multiply in assembler, It would have to do something like var Since there's some alignment in it, in theory this could be made blazingly Whenever you need the HSL rounded results you just round the values to I could give you more info on the conversion matrix, but please try to find Kind regards, Nils Haeck It depends in what kind of color depth you want to work. QuoteRolf Hansen <rolfnos...@nospambitspaper.de> wrote in message Quote> Hello, |
Nils
![]() Delphi Developer |
Sun, 05 Dec 2004 10:27:25 GMT
Re:Fast way to modify hue, sat, lum of RGB bitmap[sorry if this post appears twice, doesn't seem to appear first time] Just a matrix to convert from RGB to HSL will do fine. If you use floating Lookup tables worked fine in the old days, but nowadays that's not true Perhaps you can find an algorithm that does a matrix multiply in assembler, It would have to do something like var Since there's some alignment in it, in theory this could be made blazingly Whenever you need the HSL rounded results you just round the values to I could give you more info on the conversion matrix, but please try to find Kind regards, Nils Haeck |
Andrew Rybenko
![]() Delphi Developer |
Mon, 06 Dec 2004 02:47:39 GMT
Re:Fast way to modify hue, sat, lum of RGB bitmapQuote> HSL[0] = RtoH[0, 0] * RGB[0] + RtoH[1, 0] * RGB[1] + RtoH[2, 0] * RGB[2]; If some book tells else, the author is wrong. -- create labels, logos, image lists |