Discussion:
Transparent image overlay ?
Uwe Schmitt
2013-09-26 16:48:34 UTC
Permalink
Hi,

I would like to show two overlayed images with transparency.
One in red, the other in green, so that common colored points should get
white.

Any hint how to do this ?

Regards, Uwe
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
stefan
2013-09-26 20:12:06 UTC
Permalink
don't think you will be able to get white from mixing a red and green
channel.
With an RGB colour scale encoding, you need equal parts of red green and
blue to get white.
If you only have two parameters that contribute and you would like to have
white if both are equal and at max, you need to mix in blue at 50%
weighting. That however leads to seeing purple for one channel

Here is an example of mixing red and green only. For both together you end
up with yellow.

arr = numpy.zeros([256,256,3], dtype='int')
arr[:,:,0] = tile(arange(256),[256,1]) # decreasing red from left to
right
arr[:,:,1] = tile(arange(256),[256,1]).T # decreasing green from top to
bottom
imshow(arr)
print arr[0,0,:], arr[255,255,:]


When you mix in 50% blue along with each channel, you get white at the
intersect of both but each alone are either purple (bottom left) or light
blue (top right)



Not that RGB = (0,0,0) is white and RGB = (255,255, 255) is black.

Hth, S
Post by Uwe Schmitt
Hi,
I would like to show two overlayed images with transparency.
One in red, the other in green, so that common colored points should get
white.
Any hint how to do this ?
Regards, Uwe
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Uwe Schmitt
2013-09-27 09:42:02 UTC
Permalink
Thanks, achieving white was not my goal I and I have to commit that I did
not realy think about that.

In the end I want to overlay the images to see local differences and things
which are in common.
Before your post I just thoght about separate one chanel images with
colormaps. But RGB is a good
solution :)

Cheers, Uwe.
Post by stefan
don't think you will be able to get white from mixing a red and green
channel.
With an RGB colour scale encoding, you need equal parts of red green and
blue to get white.
If you only have two parameters that contribute and you would like to have
white if both are equal and at max, you need to mix in blue at 50%
weighting. That however leads to seeing purple for one channel
Here is an example of mixing red and green only. For both together you end
up with yellow.
arr = numpy.zeros([256,256,3], dtype='int')
arr[:,:,0] = tile(arange(256),[256,1]) # decreasing red from left to
right
arr[:,:,1] = tile(arange(256),[256,1]).T # decreasing green from top to
bottom
imshow(arr)
print arr[0,0,:], arr[255,255,:]
When you mix in 50% blue along with each channel, you get white at the
intersect of both but each alone are either purple (bottom left) or light
blue (top right)
Not that RGB = (0,0,0) is white and RGB = (255,255, 255) is black.
Hth, S
Post by Uwe Schmitt
Hi,
I would like to show two overlayed images with transparency.
One in red, the other in green, so that common colored points should get
white.
Any hint how to do this ?
Regards, Uwe
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Stefan A Reinsberg
2013-09-26 20:15:33 UTC
Permalink
Darn, images disappeared. Let's try this again.

arr = numpy.zeros([256,256,3], dtype='int')
arr[:,:,0] = tile(arange(256),[256,1]) # decreasing red from left to right
arr[:,:,1] = tile(arange(256),[256,1]).T # decreasing green from top to bottom
imshow(arr)



arr = numpy.zeros([256,256,3], dtype='int')
arr[:,:,0] = tile(arange(256),[256,1]) # decreasing red from left to right
arr[:,:,2] = tile(arange(256),[256,1])/2 # decreasing blue (50%) left to right
arr[:,:,1] = tile(arange(256),[256,1]).T # decreasing green from top to bottom
arr[:,:,2] = tile(arange(256),[256,1]).T/2 # decreasing blue (50%) from top to bottom
imshow(arr)
Post by Uwe Schmitt
Hi,
I would like to show two overlayed images with transparency.
One in red, the other in green, so that common colored points should
get white.
Any hint how to do this ?
Regards, Uwe
--
You received this message because you are subscribed to the Google
Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "guidata/guiqwt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guidata_guiqwt+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Continue reading on narkive:
Loading...