Path: news.mathworks.com!not-for-mail
From: "Robert Johansson" <robert.nospam@math.umu.se>
Newsgroups: comp.soft-sys.matlab
Subject: Re: reading gif
Date: Tue, 6 May 2008 18:50:20 +0000 (UTC)
Organization: Ume&#229;
Lines: 106
Message-ID: <fvq99c$dje$1@fred.mathworks.com>
References: <fvl2ih$khs$1@fred.mathworks.com> <muy4p9bibud.fsf@G99-Boettcher.llan.ll.mit.edu>
Reply-To: "Robert Johansson" <robert.nospam@math.umu.se>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210099820 13934 172.30.248.37 (6 May 2008 18:50:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 May 2008 18:50:20 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1129354
Xref: news.mathworks.com comp.soft-sys.matlab:466985


Peter Boettcher <boettcher@ll.mit.edu> wrote in message 
<muy4p9bibud.fsf@G99-Boettcher.llan.ll.mit.edu>...
> 
> [correcting top-post]
> 
> "Robert Johansson" <robert.nospam@math.umu.se> writes:
> 
> > Steve Eddins <Steve.Eddins@mathworks.com> wrote in 
message 
> > <fvpn6m$rt6$1@fred.mathworks.com>...
> >> Robert Johansson wrote:
> >> > The matrix that I get from imread (and importdata) 
is of size
> >> > 87x87, that is not even close to what is needed to 
get a correct
> >> > version of the picture. I know what the picture 
should look
> >> > like. This is the file info:
> >> > 
> >> >            FileSize: 3464
> >> >              Format: 'GIF'
> >> >       FormatVersion: '89a'
> >> >               Width: 87
> >> >              Height: 87
> >> >            BitDepth: 8
> >> >           ColorType: 'indexed'
> >> >     FormatSignature: 'GIF89a'
> >> >     BackgroundColor: 0
> >> >         AspectRatio: 0
> >> >          ColorTable: [256x3 double]
> >> >          Interlaced: 'no'
> >> > 
> >> > If I examine the file properties by right-clicking 
on it, the
> >> > system tells me that the size is given in "points" 
(87x87). Its a
> >> > picture of a logo which i want to use in LaTeX so my 
idea was to
> >> > convert it to eps with MATLAB.
> 
> >> Sounds to me like you have a GIF file containing 87 
rows and 87
> >> pixels, and this is what imread is giving you.  It 
also sounds to me
> >> like the Windows file properties dialog is confirming 
this for you.
> >> 
> >> Try reading the image file using some other 
application if you still
> >> have doubts.
> >> 
> >> Where is your notion of "correct version of the 
picture" coming from?
> >
> >
> > Its a logotype. 
> >
> > http://www.umu.se/umu/profil/allmant/logotyp.html
> >
> > The one to the left is of size 101x101 but a matrix of 
> > 101x101 is not enough to describe it. I guess that it 
has 
> > something to do with to file format.
> 
> What?  You really need to explain what you mean by "not 
enough to
> describe it", or "not even close to what is needed to get 
a correct
> version of".  Everything seems entirely consistent.  The 
image has size
> 101x101 pixels.  It is displayed at exactly that size on 
the web.
> Windows "properties" says it is 101x101 pixels.  When you 
read it into
> MATLAB you get a matrix of 101x101 pixels.
> 
> And when I display the 101x101 matrix in MATLAB, it looks 
exactly like
> the web.
> 
> Maybe the code you use to display the image is wrong?  
Here's what I
> did:
> 
> [s map] = imread('UMU_pos.gif');
> image(s);
> colormap(map);
> truesize;
> 
> 
> 
> -Peter

I'm sorry if my explanation was poor. If I do the 
conversion to eps with my own code, or with your code, I 
get a new picture of poor quality. I scaled the eps with 
LaTeX to exactly the same size as the original (20mm) and 
put them side by side to be sure. There is no doubt that 
something has been lost or distorted. Maybe this is a 
problem with conversion from gif to eps that can't be 
avoided with this method? I was just surprised that I didnt 
get the same result when I read the gif-file and converted 
it with MATLAB.

/Robert