Key Colour transitions [chroma key] 16-bit vs 32-bit for a jpeg image



bhavnarohra@hotmail.com
07-09-2005, 10:34 PM
Hello,

I am not sure if this is the right group to post this.

I am programming in direct show and adding a Chroma key transition to
a timeline. The fact here here is that i cannot get the chroma key
working with jpeg in my timeline.

To put it more:
I have a blue bitmap and a blue jpeg. Both of them have images on it.
If i put the blue bitmap in a timeline, it and i add a chroma key with
rgb as (0,0,255), the background is made transparent and only the image
is visible. But if i put the blue jpeg and i key it on the same color,
the background is not made transparent. All this is when i work on a
16-bit colour quality of the system.

If i change the colour quality of the system to 32-bit the background
is made transparent but i can see blue edges on the
side of the image . that could be because the color blue is not uniform
through out the jpeg. Anyway but is there any dependency of the chroma
key with 16-bit vs 32-bit?

Can someone help me with this or can someone guide me to a proper group
to get help on this.

any help with this will be appreciated.

Thank you

Rehan
07-09-2005, 10:34 PM
I have had some experience with chroma key and its related issues. It is
obvious that the compresion in jpeg image is interfering. Why do you
must use JPEG? jpeg wont preserve the fidelity of your chroma color due
to its lossy compression.

What might be happening is the system is decompressing it to a system
bitmap which is either a 16 bit or 32 bit according to screen
resolution. The chroma key only sees the uncompressed image. So how it
got decompressed is important. With bitmap there is no decompression
involved.

Since the JPEG compression is lossy the system doesnt need to decompress
the colors to exact color values. Furthermore some sort of dithering may
also be involved. An interesting experiment to try is to see how a
compresed PNG behaves. I expect it to behave exactly like BMPs.

--
Rehan
MS MVP (Digital Media)
www.rehanfx.org -- get effects & transitions for MM2



bhavnarohra@hotmail.com wrote:
> Hello,
>
> I am not sure if this is the right group to post this.
>
> I am programming in direct show and adding a Chroma key transition to
> a timeline. The fact here here is that i cannot get the chroma key
> working with jpeg in my timeline.
>
> To put it more:
> I have a blue bitmap and a blue jpeg. Both of them have images on it.
> If i put the blue bitmap in a timeline, it and i add a chroma key with
> rgb as (0,0,255), the background is made transparent and only the image
> is visible. But if i put the blue jpeg and i key it on the same color,
> the background is not made transparent. All this is when i work on a
> 16-bit colour quality of the system.
>
> If i change the colour quality of the system to 32-bit the background
> is made transparent but i can see blue edges on the
> side of the image . that could be because the color blue is not uniform
> through out the jpeg. Anyway but is there any dependency of the chroma
> key with 16-bit vs 32-bit?
>
> Can someone help me with this or can someone guide me to a proper group
> to get help on this.
>
> any help with this will be appreciated.
>
> Thank you
>


--
Rehan
MS MVP (Digital Media)
www.rehanfx.org -- get effects & transitions for MM2

bhavnarohra@hotmail.com
07-09-2005, 10:34 PM
Hello,

Thanks for ur reply. I have even tried out using the Similarity
property of this transition. If i understand this properly, similarity
atleast should be able to key jpegs even if there is some lossy
compression, cause it should consider values above and below some
percentage of the given absolute colour. But it does not seem to take
that either. The video appears to be shimering and the colour of the
image changes changes entirely. What appears is a kind of golden video
depending on what percent of similarity i have applied.

Have u used the Similarity property for this transition. Does it work
for u... What am i doing wrong. Can u guide me to some documents that
can explain this more clearly ?

Any help will be appreciated.
Thank You

Rehan
07-09-2005, 10:34 PM
bhavnarohra@hotmail.com wrote:
> I have even tried out using the Similarity
> property of this transition. If i understand this properly, similarity
> atleast should be able to key jpegs even if there is some lossy
> compression,

....

> Have u used the Similarity property for this transition. Does it work
> for u... What am i doing wrong. Can u guide me to some documents that
> can explain this more clearly ?
>

Yes I have tried Similarity parameter and have been frustrated by it as
you are. it seems to be completely broken. Many updates to DirectX have
failed to fix this so it seems it is not on MS priority list.

I am planning to make a Chroma plugin for movie maker which should allow
Similarity together with some more cool features such as: "Subtract
first frame". Send in your suggestions.


--
Rehan
MS MVP (Digital Media)
www.rehanfx.org -- get effects & transitions for MM2


Key Colour transitions [chroma key] 16-bit vs 32-bit for a jpeg image