Effacer les filtres
Effacer les filtres

How do you save a tiff or bitmap as a certain pixel resolution?

4 vues (au cours des 30 derniers jours)
Andy
Andy le 18 Juil 2012
I specifically neeed to save my images in 1024 by 768 but can't figure out how. trusize is too large for my screen so it automatically gets resized to 56% of its original size when i use it with getframe.Im trying to get homogenously grey images of decreasing grey to get the full gray spectrum for a gamma calibratiin and just cant save the resolution. This has been pretty wordy but any help wuld be greatly appreciated! Andy
for ii = 1:4:grayscales;
Img = 0 + (ii - 1);
figure('ColorMap', gray(256)); image(Img);axis equal; axis tight;
axis off;
truesize(gcf,[1024 768]);
Image = getframe(gcf);
%imwrite(Image.cdata,['gray',num2str(ii),'.tiff'], 'Resolution', [500]);
imwrite(Image.cdata,['gray',num2str(ii),'.bmp']);
close all

Réponse acceptée

Kevin Claytor
Kevin Claytor le 18 Juil 2012
Instead of trying to save the capture of the frame with the image, why not save the image itself with something like;
Img = 0 + (ii - 1);
imwrite(Img,['gray',num2str(ii),'.bmp']);
Also I'm kind of confused, because Img seems to be a scalar, and not an actual image? Do you want an entire image of a single level of gray? You could create that image with something more like;
Img = ones(768,1024) * graylevel;
  1 commentaire
Andy
Andy le 18 Juil 2012
yeah! Img = ones(768,1024) * grayscale; worked! Thank you; miss the simple stuff sometimes!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by