hamid nazeri
hamid nazeri

Reputation: 31

image is too big to fit in the screen (MATLAB)

I got an error in Matlab which is

Warning: Image is too big to fit on screen; displaying at 33%

and my source code for this part is this :

watermarked_image_uint8=uint8('watermarked_image');
%# write watermarked Image to file 
imwrite(watermarked_image_uint8,'watermarked_image','jpeg');
%# display watermarked image figure(1) 
imshow(watermarked_image), title('Watermarked_Image')

Can any one help me please to debug this warning?

Upvotes: 3

Views: 15969

Answers (6)

Jordan Mackie
Jordan Mackie

Reputation: 2405

I also found this error when running from the command line with the -nodisplay argument (what I really wanted was -nodesktop).

Upvotes: 0

Pankaj Pateriya
Pankaj Pateriya

Reputation: 641

this is simply warning you are facing, so either identify the unique number of warning and then suppress it or you can use

imshow(watermarked_image, 'InitialMagnification', 50);

this will help you to reduce the size of your image and fit it on the screen.

Upvotes: 0

Richie Cotton
Richie Cotton

Reputation: 121187

As Ghaul said, the warning is nothing to worry about. Use the InitialMagnification argument to imshow to make your image smaller, or turn the warning off, if it annoys you.

Upvotes: 4

Juan
Juan

Reputation: 1540

I guess you could do something like get first the size of the screen, create a figure and then set the your window size, for example:

plot_size = get(0,'ScreenSize');
fg = figure(1);
set(fg, 'Color', [1 1 1], 'Position', plot_size, 'Visible', 'on');
imshow(watermarked_image), 
title('Watermarked_Image') 

Upvotes: 2

Ghaul
Ghaul

Reputation: 3330

It's not an error, just a warning that the resolution of the image you are showing is larger than the resolution of your Matlab window, so Matlab has to reduce the size of the image before displaying it.

It has nothing to do with your code, and it won't effect your results, so you can safely ignore it.

Upvotes: 8

user690760
user690760

Reputation: 21

You should probably try to change the resolution of your image so that it would fit in your screen. To check for your screen resolution check this site :

http://www.whatismyscreenresolution.com/

Try using images with lower or the same resolution with your monitor. To change the resolution of your image you can use paint or any photo editors.

Hope it helps.

Upvotes: 2

Related Questions