how to implement visible watermark on image in matlab ??

hi , i want to algorithm to implement visible watermark in image

2 Comments

I want the code for adding text watermark on the image
What does that mean? Do you mean you want to hide text in an image, like my attached program? Or do you want to watermark an image with an image of text (like my other attached demo)?

Sign in to comment.

Answers (1)

Simply average the two images, or paste it in, like my attached demo shows. Let me know if you need further help.

7 Comments

thanks for you , but i need to apply it on RGB image not gray
It still can work. See this demo code:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
image1 = imread('peppers.png');
% Get the dimensions of the image.
[rows1, columns1, numberOfColorBands] = size(image1);
subplot(2,2,1);
imshow(image1);
image2 = imread('onion.png');
% Get the dimensions of the image.
[rows2, columns2, numberOfColorBands] = size(image2);
subplot(2,2,2);
imshow(image2);
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
canvass = zeros(size(image1));
canvass(1:rows2, 1:columns2, :) = image2;
% Mask the image using bsxfun() function
blendedRgbImage = (double(image1) + canvass) / 2;
subplot(2,2,3);
imshow(uint8(blendedRgbImage));
% Create the final image, where the "zero" part is not half intensity.
finalRGBImage = image1;
finalRGBImage(1:rows2, 1:columns2, :) = blendedRgbImage(1:rows2, 1:columns2, :);
subplot(2,2,4);
imshow(finalRGBImage);
thanks for you the problem is solved =D
You're welcome. Can you then go ahead and please officially mark it as solved by clicking the "Accept this answer" link? Thanks in advance.
how does imread for peppers.png and onion.png work even if they are not present in the MATLAB folder?
You'd have to specify the full path (folder plus base file name), unless it's on the search path, which you can see by typing path on the command line. For a specific file, you can find the folder it's in by using the fileparts() and which() functions:
>> folder = fileparts(which('peppers.png'))
folder =
'C:\Program Files\MATLAB\R2020a\examples\deeplearning_shared\data'
Matlab Folder is NOT only ‘Current Working Folder’.
Matlab search all paths that exist in MATLABPTH.
One can check with the Matlab command ‘path’ in the command window.
Matlab stores some images, videos and relevant data in its respective toolbox demo folders.
Like images ‘onion.png’ and ‘peppers.png’ in the below path (example). This path presents in MATLAB search path.
“Matlab Installation Folder\toolbox\images\imdemos”
Example: C:\Program Files\MATLAB\R2012a\toolbox\images\imdemos

Sign in to comment.

Tags

Asked:

on 23 Dec 2014

Edited:

on 25 May 2020

Community Treasure Hunt

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

Start Hunting!