Transparent Image on Background

版本 1.0.0.0 (958 字节) 作者: Gauthier Fleutot
Allows to merge a background with a transparent foreground without using alphadata.
6.2K 次下载
更新时间 2004/7/30

无许可证

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.

引用格式

Gauthier Fleutot (2024). Transparent Image on Background (https://www.mathworks.com/matlabcentral/fileexchange/5575-transparent-image-on-background), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13SP1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Images 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0