Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!llnews!53ab2750!not-for-mail
From: Peter Boettcher <boettcher@ll.mit.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: imwrite
References: <gp3jdf$1sn$1@fred.mathworks.com>
	<muy63iili8f.fsf@G99-Boettcher.llan.ll.mit.edu>
	<gp3o75$rr7$1@fred.mathworks.com>
Message-ID: <muy1vt6ld8c.fsf@G99-Boettcher.llan.ll.mit.edu>
Organization: MIT Lincoln Laboratory
User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux)
Cancel-Lock: sha1:puBS3p2qpxzSaX4vqF4RpxOkUhg=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 50
Date: Mon, 09 Mar 2009 15:15:15 -0400
NNTP-Posting-Host: 155.34.163.93
X-Complaints-To: news@ll.mit.edu
X-Trace: llnews 1236626115 155.34.163.93 (Mon, 09 Mar 2009 15:15:15 EDT)
NNTP-Posting-Date: Mon, 09 Mar 2009 15:15:15 EDT
Xref: news.mathworks.com comp.soft-sys.matlab:523568


"Oluwa KuIse" <wespeakforex@yahoo.com> writes:

> Peter Boettcher <boettcher@ll.mit.edu> wrote in message <muy63iili8f.fsf@G99-Boettcher.llan.ll.mit.edu>...
>> "Oluwa KuIse" <wespeakforex@yahoo.com> writes:
>> 
>> > Hello, Can anyone please help me out with the imwrite function.  When
>> > I use it, it creates the file quite alright but it doesn't display the
>> > image. I have tried it with both the .png and .jpeg formats. Any
>> > suggestions? 
>> 
>> What problem are you having?  imwrite is supposed to create the file.
>> It is not supposed to display anything.  Are you looking for image() or
>> imshow() instead?  Or would you specifically like to do something with
>> the image file after it is written?
>> 
>> -Peter
>
> Hi, Peter,
> Thanks for your fast response. What I want to do is for MATLAB to be able to display my image in any file I want outside of MATLAB. The results (images) are to be displayed elsewhere and not on MATLAB's figure window. These are the last lines of the program:
> source_color = im2uint8([.5 .5 1]);
> E = im2uint8(mat2gray(E));
> red = E;
> green = E;
> blue = E;
> red(BW) = source_color(1);
> green(BW) = source_color(2);
> blue(BW) = source_color(3);
> rgb_bottom = cat(3, red, green, blue);
> imshow(rgb_bottom, 'InitialMag', 'fit')
>
> % Make a second RGB image that is a constant green.
> rgb_top = zeros(size(M,1), size(M,2), 3, 'uint8');
> rgb_top(:,:,2) = 255;
>
> % Turn the influence or dependence map into an AlphaData channel to be used
> % to display with the green image.
> M(BW) = 0;
> M = imadjust(mat2gray(M), [0 1], [0 .6], 0.5);
>
> image('CData', rgb_top, 'AlphaData', M);
>
> Question: Image() displays the image in a MATLAB figure window. I want to be able to display this image in say, .jpeg. 
> Thank you!

Ah.  Use "saveas" or "print" to take a snapshot of your figure window
and export it to a file.



-Peter