hlstriker Posted January 19, 2009 Share Posted January 19, 2009 Does anyone know how to convert grayscale to a selected color? Say you have a palette ranging from black to white. Would it be possible to create a new palette based from the grayscale palette but with shades of blue instead. For instance the lighter the shade of gray, the lighter the blue will be. (the same going for the darker the shade of gray the darker the shade of blue will be). I could manually make my own blue palette but then every time I change the color I would have to create a new palette. So does anyone know how to do this dynamically? Quote Link to comment https://forums.phpfreaks.com/topic/141413-gd-grayscale-to-color/ Share on other sites More sharing options...
.josh Posted January 19, 2009 Share Posted January 19, 2009 what format are you using for this grayscale? give an example number. Quote Link to comment https://forums.phpfreaks.com/topic/141413-gd-grayscale-to-color/#findComment-740253 Share on other sites More sharing options...
hlstriker Posted January 19, 2009 Author Share Posted January 19, 2009 I'm not sure what you mean by format (png?) but I am using a color palette with all gray colors. Black to white: 0,0,0 15,15,15 50,50,50 125,125,125 255,255,255 I'm just trying to make a new 256 color palette using the old gray palette shades. So light gray is light blue, and dark gray is dark blue on the new palette. Quote Link to comment https://forums.phpfreaks.com/topic/141413-gd-grayscale-to-color/#findComment-740258 Share on other sites More sharing options...
.josh Posted January 19, 2009 Share Posted January 19, 2009 okay so you have 3 numbers. Those numbers symbolize red, green, blue. From black to blue is 0,0,0 to 0,0,255. from blue to white is 0,0,255 to 255,255,255. You will want to keep the first 2 numbers as the same to change the shade of the bluescale. Quote Link to comment https://forums.phpfreaks.com/topic/141413-gd-grayscale-to-color/#findComment-740260 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.