Making color "see-thru" without changing it's color?

Alright, whenever you make a color translucent it reduces the overall intensity of the color, the color itself is reduced by the translucency given.

However, I wonder if there’s a way to make a color translucent, or “see thru”, without the color being changed?

Or is that not possible?

Example:

(photoshopped, color c found by eye)

http://gamadu.com/temp/colorseethru.png

I have color a, which I want to make translucent so it becomes color b, but I want it to be like color c.

The reason is it’s now mixed with the color behind it, if the color behind it is white then it will appear to lose saturation because white is de-saturated. You could increase the saturation of the color while making it transparent if you want it to look less washed out.

Edit:
In your example above you are using additive blending which is not supported in the Java graphics stack without using a custom composite.

Is there some mathematical formula to do that?

Hrm… Of course when you are overlapping one or more translucent colors / shapes intensity will be modified, but are you commenting say compositing a translucent object on a white background where the background itself affects the color intensity. I suppose if you could work out some way to composite a scene without taking into account the background you’d accomplish this. Perhaps modifying directly a BufferedImage. This seems more like a compositing problem. I can’t off the top of my head think of a non-custom way to accomplish this.

You could calculate it for a white background, but you won’t be able to get any color component brighter than the alpha value. It sounds like you want additive blending, in which case you have to write a custom composite or directly manipulate the image buffer.

Not that I’ve played around with this, but I believe it’s easier to modify saturation with HSV vs RGB.


http://en.literateprograms.org/RGB_to_HSV_color_space_conversion_(C)

Just divide the R/G/B values by the alpha to darken them and I think it will work.

Edit:
On second thought that won’t work.

Umm, even java.awt.Color accepts an alpha-channel.

[EDIT] never-mind, I didn’t take a close enough look at your image.
Correct me if I’m wrong but isn’t that what you are looking for?

Basically for each channel (rgb) you have have (255-alpha) colors to work with so if the color you are after is not in that range you can’t do it.

Try setting each RGB component to (dest + alpha - 1.0)/alpha where dest is the color you are after when composting to a white background, if any work out to be outside the range 0.0 - 1.0 you can’t do it.

Yea, thought so.

Was just curious about this. Thanks.

You can hack it. Make a list of colors you want to be able to see, or colors you don’t want to see, and exchange the pixels :smiley: Sure, it’s not going to run well if you do it in real-time.

Maybe additive blending is what you want?

It looks a lot like subtracting the negative of the target from the source. So white doesn’t subtract anything at all, and black turns into, well, black. I’m not sure if there’s a built-in blending equation for that but I’m not a blending expert.

A little hard to know exactly what you want given the background is monochrome.

Some links that might be of help

That description is really familiar, but I can’t put my finger on the name for it. Linear Burn seems closest (if not the same - not enough coffee yet! :clue: )

Best wishes, Neil

Yeah… taking into account a background as others have mentioned I don’t think you’ll reach a satisfactory result per se with color modification or saturation. You might get close I suppose. Also it will help to know if you want to work with a 2D API IE Java2D / Android 2D API or GL. Off the top of my head thinking aloud could you have too buffers and do some minor compositing. IE have an RGBA image you draw the text and your translucent shapes into then have a separate image as your background then do a Porter-Duff replace op when blending the text/shape image on top of the background image. Could that possibly work out?