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 次查看(过去 30 天)
%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');

回答(1 个)

Image Analyst
Image Analyst 2014-12-10
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 个评论
Ahmad Nor
Ahmad Nor 2014-12-11
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 2014-12-11
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by