how to create an image from text file?
4 views (last 30 days)
Show older comments
%i hav created an text file from an image..... how to create an image from text file...?thanks %i have added my code
a=imread('coins.png');
dlmwrite('1.txt',a,'delimiter',' ');
0 Comments
Answers (1)
Image Analyst
on 25 Apr 2014
Use dlmread(). Did you try this:
filename = 'coins.txt';
grayImage = imread('coins.png');
dlmwrite(filename, grayImage, 'delimiter',' ');
recalledImage = dlmread(filename, ' ');
whos recalledImage;
grayImage = uint8(recalledImage); % Convert to uint8.
whos grayImage;
% Check against original
differenceImage = abs(recalledImage - double(grayImage));
max(differenceImage(:))
delete(filename); % Delete temporary text file.
0 Comments
See Also
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!