4.33333

4.3 | 3 ratings Rate this file 15 Downloads (last 30 days) File Size: 958 Bytes File ID: #5575
image thumbnail

Transparent Image on Background

by Gauthier Fleutot

 

28 Jul 2004 (Updated 30 Jul 2004)

Allows to merge a background with a transparent foreground without using alphadata.

| Watch this File

File Information
Description

This quite simple function (immerge.m, as in "image merge") allows to display two images, one on each other, the one in the foreground being transparent (transparency weighted).

Creates an image 'out'.
'out' has 'bg' as background, and 'fg' (transparent, weighted by 'coef') above 'bg'.
Useful when one cannot use OpenGL as renderer, but still wants to have transparency!
'out', 'bg', and 'fg' are RGB images.

merged = immerged(bg, fg, coef)
- bg matrix of type double or uint8
- fg matrix of type double or uint8
- coef is a scalar between 0 and 1, or a matrix of such scalars, same (r,c) size as 'fg' and 'bg' (similar to AlphaData).

Suggestions for future development:
- allow to have 'coef' referring to the AlphaMap
- allow 'coef' to take values between 1 and 64.

The function comes with a short demo script.

MATLAB release MATLAB 6.5.1 (R13SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
09 Nov 2004 Peter Cremona-Simmons

I could not try/use it because imview() function is not available to me.

18 Jan 2007 Jamie Simpson

Works great. I was able to use it for functions other than imview(). Just substitute the graphing function you want with imview(), such as pcolor(), for example.

29 Mar 2008 suman ghosh  
26 Nov 2008 Shadi

Works great with me.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui Gauthier Fleutot 22 Oct 2008 07:28:36
display Gauthier Fleutot 22 Oct 2008 07:28:36
annotation Gauthier Fleutot 22 Oct 2008 07:28:36
transparent transparency opengl merge background foreground weig Gauthier Fleutot 22 Oct 2008 07:28:36

Contact us at files@mathworks.com