Convert xlsx to jpg
Show older comments
Hello everyone,
I work on a project matlab for my company and i need help.
I want to know if it's possible on matlab to convert an xlsx file to image ?
if it's possibe, how can i do that.
Thank you!
Answers (1)
Image Analyst
on 26 Jun 2020
Yes. Try readmatrix
myImage = readmatrix('my image.xlsx');
imshow(myImage);
If that doesn't work, try xlsread() or attach your workbook.
5 Comments
Abbass SAYEGH
on 26 Jun 2020
Image Analyst
on 26 Jun 2020
You'd have to extract the R, G, and B parts of the matrix and then combine them. Like let's say the R, G, and B images were side by side in your workbook. Then you'd do
[rows, columns] = size(myImage);
columns1 = columns/3;
r = myImage(:, 1:columns1);
g = myImage(:, columns1 + 1 : 2*columns1);
b = myImage(:, 2*columns1+1:end);
rgbImage = uint8(cat(3, r, g, b)); % Or uint16 whatever you're using.
Abbass SAYEGH
on 26 Jun 2020
Abbass SAYEGH
on 29 Jun 2020
Image Analyst
on 29 Jun 2020
right after you call imshow(), call impixelinfo()
hp = impixelinfo;
If you want to reposition it, you can use
hp.Units = 'normalized';
hp.Position = [x, y, .2, .03]; % All values in the range 0-1.
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!