Is there a problem if I use DummyImage to call an image in GUI? Because the saved processed image size difference is too big compared to original image. For example,original image is 458 kB but saved image is only 98 kB.

1 view (last 30 days)
%load image
axes(handles.axes1);
handles.DummyImage = uigetfile({'*.jpg';'*.jpeg';'*.png';'*.bmp'});
guidata(hObject,handles);
I=imread(handles.DummyImage);
imshow(I);
%example of processing method
axes(handles.axes2);
L=imread(handles.DummyImage);
J=adapthisteq(L);
imshow(J);
%Save button
axes(handles.axes2);
[FileName, PathName] = uiputfile({'*.jpg';'*.tif';'*.png';'*.gif';'*.jpeg'});
Name = fullfile(PathName,FileName);
hChildAxes2 = get(handles.axes2,'Children');
W = get(hChildAxes2(1),'CData');
imwrite(W, Name,'jpg');

Answers (1)

Image Analyst
Image Analyst on 10 Dec 2014
What format did you read in? The jpg format you saved it in may be much more compressed than the original image. You should virtually never use jpg for imaging applications, certainly not image analysis applications. Use lossless compression format PNG like most everyone else is these days.
  2 Comments
Ahmad Nor
Ahmad Nor on 11 Dec 2014
Thanks for the suggestion sir.
I've tried processing various type of image from png, tif to jpg. I save the processed image using the same type as the original (png/tif/jpg). They seems to lost about +/- 100 kB after the process was done. It is normal? I'm just afraid if the difference is too big it will affect the image quality.
Image Analyst
Image Analyst on 11 Dec 2014
There will be no loss of image quality if you use TIFF or PNG . There probably will be if you use jpg, but not if you use the lossless options of JPG2000.

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!