Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Hi-resolution jpeg or vectorial graphics?

Subject: Hi-resolution jpeg or vectorial graphics?

From: Vittorio

Date: 28 Jan, 2013 23:04:08

Message: 1 of 4

Hello,

I'm writing for the first time to the community because I need help in generating an image. I have an image that I plot using pcolor, it is the rendering of an electromagnetic imaging algorithm (it looks like a sort of mri). I have to overlap on top of this image a couple of simple shapes (circles, lines, etc) to indicate the actual position of the objects that I am imaging. I need the output to be a very high resolution jpeg or a vector graphics image.

As far as I know there are two ways to do that, and I am failing at both :)

1) Save the image obtained with pcolor as eps, then somehow overlap to it the circles/lines, and save everything as a new eps. I simply don't know how to manipulate eps files, so this has failed me. Using eps might or might not make sense, since my original image is like an mri, not at all vectorial-looking.

2) Save the image as a high resolution Jpeg and then "photoshop" on top of it the circles/lines. The problem here is that when I save the image its resolution turns out to be 96 dpi, which is not sufficient (I need at least 300 dpi). I have tried also this:
print(h,'-djpeg','-r300','image_hires.jpg')
but it does not work. In the properties of window it says it is still 96 dpi, and when I have the image checked by the online tool that has to approve it, it says that the resolution actually became 72 dpi.

Does anybody have suggestions on how I should proceed? By the way, I am using MATLAB R2011b.

Thanks in advance,
Vittorio

Subject: Hi-resolution jpeg or vectorial graphics?

From: anyone

Date: 30 Jan, 2013 20:03:43

Message: 2 of 4

On Mon, 28 Jan 2013 23:04:08 +0000, Vittorio wrote:

> Hello,
>
> I'm writing for the first time to the community because I need help in
> generating an image. I have an image that I plot using pcolor, it is the
> rendering of an electromagnetic imaging algorithm (it looks like a sort
> of mri). I have to overlap on top of this image a couple of simple
> shapes (circles, lines, etc) to indicate the actual position of the
> objects that I am imaging. I need the output to be a very high
> resolution jpeg or a vector graphics image.
>
> As far as I know there are two ways to do that, and I am failing at both
> :)
>
> 1) Save the image obtained with pcolor as eps, then somehow overlap to
> it the circles/lines, and save everything as a new eps. I simply don't
> know how to manipulate eps files, so this has failed me. Using eps might
> or might not make sense, since my original image is like an mri, not at
> all vectorial-looking.
>
> 2) Save the image as a high resolution Jpeg and then "photoshop" on top
> of it the circles/lines. The problem here is that when I save the image
> its resolution turns out to be 96 dpi, which is not sufficient (I need
> at least 300 dpi). I have tried also this:
> print(h,'-djpeg','-r300','image_hires.jpg')
> but it does not work. In the properties of window it says it is still 96
> dpi, and when I have the image checked by the online tool that has to
> approve it, it says that the resolution actually became 72 dpi.

Well, that's odd. I more or less routinely save figures to high-res png and jpg -- similar to your syntax -- and that
works as expected. I usually use Gimp, Paint Shop Pro, or Inkscape for post-edit, and each of those will show dpi
or ppi that is entirely consistent with my Matlab choice, from R2012b and further back than R2009a.

> Does anybody have suggestions on how I should proceed?

Nope.

>By the way, I am using MATLAB R2011b.

> Thanks in advance,

For what?

Subject: Hi-resolution jpeg or vectorial graphics?

From: Vittorio

Date: 31 Jan, 2013 01:28:12

Message: 3 of 4

Thank you. It's people like you that make this community invaluable.

Luckly I solved my problem by placing an EPS wrapper around a JPEG, using sam2p (http://code.google.com/p/sam2p/).

Vittorio

anyone <jaup@h/WSWLG{nR1³qHe> wrote in message <51097c9f$0$51973$c3e8da3$5d8fb80f@news.astraweb.com>...
> On Mon, 28 Jan 2013 23:04:08 +0000, Vittorio wrote:
>
> > Hello,
> >
> > I'm writing for the first time to the community because I need help in
> > generating an image. I have an image that I plot using pcolor, it is the
> > rendering of an electromagnetic imaging algorithm (it looks like a sort
> > of mri). I have to overlap on top of this image a couple of simple
> > shapes (circles, lines, etc) to indicate the actual position of the
> > objects that I am imaging. I need the output to be a very high
> > resolution jpeg or a vector graphics image.
> >
> > As far as I know there are two ways to do that, and I am failing at both
> > :)
> >
> > 1) Save the image obtained with pcolor as eps, then somehow overlap to
> > it the circles/lines, and save everything as a new eps. I simply don't
> > know how to manipulate eps files, so this has failed me. Using eps might
> > or might not make sense, since my original image is like an mri, not at
> > all vectorial-looking.
> >
> > 2) Save the image as a high resolution Jpeg and then "photoshop" on top
> > of it the circles/lines. The problem here is that when I save the image
> > its resolution turns out to be 96 dpi, which is not sufficient (I need
> > at least 300 dpi). I have tried also this:
> > print(h,'-djpeg','-r300','image_hires.jpg')
> > but it does not work. In the properties of window it says it is still 96
> > dpi, and when I have the image checked by the online tool that has to
> > approve it, it says that the resolution actually became 72 dpi.
>
> Well, that's odd. I more or less routinely save figures to high-res png and jpg -- similar to your syntax -- and that
> works as expected. I usually use Gimp, Paint Shop Pro, or Inkscape for post-edit, and each of those will show dpi
> or ppi that is entirely consistent with my Matlab choice, from R2012b and further back than R2009a.
>
> > Does anybody have suggestions on how I should proceed?
>
> Nope.
>
> >By the way, I am using MATLAB R2011b.
>
> > Thanks in advance,
>
> For what?
>

Subject: Hi-resolution jpeg or vectorial graphics?

From: anyone

Date: 31 Jan, 2013 01:35:33

Message: 4 of 4

On Thu, 31 Jan 2013 01:28:12 +0000, Vittorio wrote:

> Thank you. It's people like you that make this community invaluable.

No charge.

> Luckly I solved my problem by placing an EPS wrapper around a JPEG,
> using sam2p (http://code.google.com/p/sam2p/).

You must have a uniquely odd configuration.
 
> anyone <jaup@h/WSWLG{nR1³qHe> wrote in message
> <51097c9f$0$51973$c3e8da3$5d8fb80f@news.astraweb.com>...
>> On Mon, 28 Jan 2013 23:04:08 +0000, Vittorio wrote:
>>
>> > Hello,
>> >
>> > I'm writing for the first time to the community because I need help
>> > in generating an image. I have an image that I plot using pcolor, it
>> > is the rendering of an electromagnetic imaging algorithm (it looks
>> > like a sort of mri). I have to overlap on top of this image a couple
>> > of simple shapes (circles, lines, etc) to indicate the actual
>> > position of the objects that I am imaging. I need the output to be a
>> > very high resolution jpeg or a vector graphics image.
>> >
>> > As far as I know there are two ways to do that, and I am failing at
>> > both :)
>> >
>> > 1) Save the image obtained with pcolor as eps, then somehow overlap
>> > to it the circles/lines, and save everything as a new eps. I simply
>> > don't know how to manipulate eps files, so this has failed me. Using
>> > eps might or might not make sense, since my original image is like an
>> > mri, not at all vectorial-looking.
>> >
>> > 2) Save the image as a high resolution Jpeg and then "photoshop" on
>> > top of it the circles/lines. The problem here is that when I save the
>> > image its resolution turns out to be 96 dpi, which is not sufficient
>> > (I need at least 300 dpi). I have tried also this:
>> > print(h,'-djpeg','-r300','image_hires.jpg')
>> > but it does not work. In the properties of window it says it is still
>> > 96 dpi, and when I have the image checked by the online tool that has
>> > to approve it, it says that the resolution actually became 72 dpi.
>>
>> Well, that's odd. I more or less routinely save figures to high-res
>> png and jpg -- similar to your syntax -- and that works as expected. I
>> usually use Gimp, Paint Shop Pro, or Inkscape for post-edit, and each
>> of those will show dpi or ppi that is entirely consistent with my
>> Matlab choice, from R2012b and further back than R2009a.
>>
>> > Does anybody have suggestions on how I should proceed?
>>
>> Nope.
>>
>> >By the way, I am using MATLAB R2011b.
>>
>> > Thanks in advance,
>>
>> For what?
>>

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us