Converting a Grayscale image to RGB(A)
hi all i was wondering if anyone knew of a way in OpenGL to take a grayscale image in memory and use an OpenGL function or set of functions to convert it into an RGB(A) image?
Disclaimer: i don't have the means right now to support shaders so i cannot solve this using shaders.
the problem is is that for every grayscale bit i have to convert each set to its rgb(a) equivalent and that is a serious waste of processor time. It would be nice to be able to dump the whole image and do the conversion that way if its possible. i hope that all that makes sense.
thanks in advance for your time!
You could just upload the data as luminance values (GL_LUMINANCE)
Why convert to an RGBA image?
Why convert to an RGBA image?
what u ask is impossible, theres no way the image can workout what the color hue a pixel is based on its luminance.
if there was a way all the black+white films would be converted
if there was a way all the black+white films would be converted
Quote:Original post by V-man
You could just upload the data as luminance values (GL_LUMINANCE)
Why convert to an RGBA image?
well i am writing this software that we store images from a camera and save them in grayscale to begin with. we want to be able to convert the images into its color equivalent(if possible) while still keeping the original grayscale images.
It's unclear what you mean. If you simply want to convert the image's internal format to RGB, just copy the grayscale value of each pixel into the colour channels. But if you want to recover the RGB values from a grayscale image, so it actually looks like it's in colour - well, as zedz says, that's obviously pretty near impossible. It'd be like being given a number, and then being expected to derive the two numbers that were added together to create that sum. There's nothing in the result to tell you how it was arrived at.
Perhaps an algorithm to put colour back into a greyscale image could be developed (I mean, if OCR can be...) - but it'd be ridiculously complicated, would require lots of hints, and would probably yield extremely dodgy results.
Perhaps an algorithm to put colour back into a greyscale image could be developed (I mean, if OCR can be...) - but it'd be ridiculously complicated, would require lots of hints, and would probably yield extremely dodgy results.
Assuming you do want to magically introduce colour information into an image that has none, and you are feeling adventurous, there has been lots of research into colourization of grey scale images.
One such example is by Ying-Qing Xu - "Natural Image Colorization"
Regards,
ViLiO
One such example is by Ying-Qing Xu - "Natural Image Colorization"
Regards,
ViLiO
I had a quick look at one of the autocolor papers,
but its no magicm, as in is still requires an artist to come along + say those flowers are red or yellow whatever.
actually this is a good example of how 'stopid' computers are (WRT to programming), it seems as if we're getting nowhere fast WRT AI
but its no magicm, as in is still requires an artist to come along + say those flowers are red or yellow whatever.
actually this is a good example of how 'stopid' computers are (WRT to programming), it seems as if we're getting nowhere fast WRT AI
If you want a computer to be smart enough to do that kind of work, then you have to duplicate a small part of the human mind in a software program. It would have to recognize all objects, possible colors certain objects would have (a car can be blue, red, metallic and a tomota is almost always red), in the scene and make artistic guesses.
And OpenGL_Guru is expecting OpenGL to be able to do this? LOL
And OpenGL_Guru is expecting OpenGL to be able to do this? LOL
LOL? Oh the impertinence.
computers (WRT to programming)..are just masses of logic..yeah?
WRT AI: it's probably even a better example of the true position of AI in the whole scheme of things: Artificial Intelligence is just like artificial sweetener; It never tastes as good as the real thing and there is generally a bitter after taste. Gee..AI might even be just as carcinogenic as aspartame!
Quote:
actually this is a good example of how 'stopid' computers are (WRT to programming), it seems as if we're getting nowhere fast WRT AI
computers (WRT to programming)..are just masses of logic..yeah?
WRT AI: it's probably even a better example of the true position of AI in the whole scheme of things: Artificial Intelligence is just like artificial sweetener; It never tastes as good as the real thing and there is generally a bitter after taste. Gee..AI might even be just as carcinogenic as aspartame!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement