November 24th, 2003, 04:03 PM
pil and alpha
hi, ive got a string in "L" i convert to RGB, how do i add an alpha channel with an alpha based on the L value
November 25th, 2003, 02:17 AM
What's the problem?
November 25th, 2003, 09:28 AM
thanks, how do i display it now? im still getting the same alpha over the whole image. should i be using glBlendFunc(GL_SRC_ALPHA,GL_DST_ALPHA)
November 25th, 2003, 09:30 AM
also, should the alpha mask be from 0-255 ot 0.0-1.0?
November 25th, 2003, 10:29 AM
I haven't got your point. Are you asking about PIL or about OpenGL?
Any of them - either mode "L" or "1", in PIL jargon. Alpha mask is full-blown PIL image, just single-banded one
November 25th, 2003, 10:45 AM
sorry about the confusion, im having troubles varying the alpha in OpenGL. I can change the overall Alpha value using glColor4f but I see no varying alpha on the texture.
im assuming the alpha channel is int's 0-255 since the RGB channels are. the putalpha method comes up with no errors but i cant get getpixel(xy) to work. ive tried
November 25th, 2003, 05:07 PM
you've almost caught it
will return 4-tuple (if your image is really RGBA) of integers in 1..255 , like
(106, 106, 106, 196)
November 26th, 2003, 12:27 AM