Thread Subject: Problem saving figures Strange White Areas

Subject: Problem saving figures Strange White Areas

From: Luigi Giaccari

Date: 14 Oct, 2009 10:20:03

Message: 1 of 4

Hi,

I barely know what a pixel is so I need help for the followong problem:

I have a figure h=figure(1) and I am trying to save it as an image (bmp or png) I use:

 saveas(h,'path','name.bmp')

It seems everything right to me but when I look at the saved image I notice that there are white areas where in the original figure they where black.

These white areas appears like a flash during the execution of the saveas command ?????

Does anybody knows anything about this problem?

Thank you

Subject: Problem saving figures Strange White Areas

From: ImageAnalyst

Date: 14 Oct, 2009 10:54:18

Message: 2 of 4

On Oct 14, 6:20 am, "Luigi Giaccari" <giaccarilu...@msn.com> wrote:
> Hi,
>
> I barely know what a pixel is so I need help for the followong problem:
>
> I have a figure h=figure(1) and I am trying to save it as an image (bmp or png) I use:
>
>  saveas(h,'path','name.bmp')
>
> It seems everything right to me but when I look at the saved image I notice that there are white areas where in the original figure they where black.
>
> These white areas appears like a flash during the execution of the saveas command ?????
>
> Does anybody knows anything about this problem?
>
> Thank you

------------------------------------------------------------
I don't use the poor MATLAB methods - it seems there are always
problems. Try using Oliver Woodford's excellent export_fig. It's
much better. It's in the File Exchange.

Subject: Problem saving figures Strange White Areas

From: Luigi Giaccari

Date: 14 Oct, 2009 11:07:02

Message: 3 of 4

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <ea20e2f4-7a56-4982-aca3-d58fd3e9a781@z24g2000yqb.googlegroups.com>...
> On Oct 14, 6:20?am, "Luigi Giaccari" <giaccarilu...@msn.com> wrote:
> > Hi,
> >
> > I barely know what a pixel is so I need help for the followong problem:
> >
> > I have a figure h=figure(1) and I am trying to save it as an image (bmp or png) I use:
> >
> > ?saveas(h,'path','name.bmp')
> >
> > It seems everything right to me but when I look at the saved image I notice that there are white areas where in the original figure they where black.
> >
> > These white areas appears like a flash during the execution of the saveas command ?????
> >
> > Does anybody knows anything about this problem?
> >
> > Thank you
>
> ------------------------------------------------------------
> I don't use the poor MATLAB methods - it seems there are always
> problems. Try using Oliver Woodford's excellent export_fig. It's
> much better. It's in the File Exchange.

Thank you,

It seems that the problem is caused because the matlab routine consider the figure background color always white even if it is set to black.

I solved it adding an uicontrol text colored in black. A little rough but it works.

Subject: Problem saving figures Strange White Areas

From: Steven Lord

Date: 14 Oct, 2009 13:16:32

Message: 4 of 4


"Luigi Giaccari" <giaccariluigi@msn.com> wrote in message
news:hb4bcm$ojo$1@fred.mathworks.com...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message
> <ea20e2f4-7a56-4982-aca3-d58fd3e9a781@z24g2000yqb.googlegroups.com>...
>> On Oct 14, 6:20?am, "Luigi Giaccari" <giaccarilu...@msn.com> wrote:
>> > Hi,
>> >
>> > I barely know what a pixel is so I need help for the followong problem:
>> >
>> > I have a figure h=figure(1) and I am trying to save it as an image (bmp
>> > or png) I use:
>> >
>> > ?saveas(h,'path','name.bmp')
>> >
>> > It seems everything right to me but when I look at the saved image I
>> > notice that there are white areas where in the original figure they
>> > where black.
>> >
>> > These white areas appears like a flash during the execution of the
>> > saveas command ?????
>> >
>> > Does anybody knows anything about this problem?
>> >
>> > Thank you
>>
>> ------------------------------------------------------------
>> I don't use the poor MATLAB methods - it seems there are always
>> problems. Try using Oliver Woodford's excellent export_fig. It's
>> much better. It's in the File Exchange.
>
> Thank you,
>
> It seems that the problem is caused because the matlab routine consider
> the figure background color always white even if it is set to black.
>
> I solved it adding an uicontrol text colored in black. A little rough but
> it works.

If I understand the problem you describe correctly, a better solution is to
use the SET function to change the figure's InvertHardcopy property to
'off':

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/figure_props.html#InvertHardcopy

That section of the documentation explains why, by default, we "switch" the
background color of the figure when you export it and changing that property
will disable this behavior.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
figure Luigi Giaccari 14 Oct, 2009 06:24:06
saveas Luigi Giaccari 14 Oct, 2009 06:24:06
bmp Luigi Giaccari 14 Oct, 2009 06:24:06
png Luigi Giaccari 14 Oct, 2009 06:24:06
image processing Luigi Giaccari 14 Oct, 2009 06:24:06
image Luigi Giaccari 14 Oct, 2009 06:24:06
strange behaviour Luigi Giaccari 14 Oct, 2009 06:24:06
rssFeed for this Thread

Contact us at files@mathworks.com