help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: Modify image.m to use bmpwrite.m on Mac OS X?


From: Joe Koski
Subject: FW: Modify image.m to use bmpwrite.m on Mac OS X?
Date: Thu, 24 Jun 2004 10:55:03 -0600
User-agent: Microsoft-Entourage/10.1.4.030702.0

------ Forwarded Message
From: Joe Koski <address@hidden>
Date: Wed, 23 Jun 2004 13:33:41 -0600
To: Octave Help <address@hidden>
Subject: Modify image.m to use bmpwrite.m on Mac OS X?

A while back, with the help of this list (Paul, I think), I was able to use
bmpwrite.m to write image files from imagesc.m to my Mac OS X screen preview
utility. It worked because there is an option M = imagesc(...) for
imagesc.m. You could then bmpwrite the M matrix after the use of imagesc.

The routine image.m does not have the M = image(...) option, so you can't
directly do a similar thing in your .m script to accomplish the same. Is
there a quick and easy modification to image.m that would allow the use
bmpwrite instead of ImageMagick to accomplish this? I don't have ImageMagick
installed, and would prefer not to install it, if possible. My first amateur
attempt at modifying image.m to do this failed, so any suggestions will be
appreciated.

Would this be a better way of modifying image.m for octave-forge for the
Mac? I found ImageMagick to be slow and memory intensive, while bmpwrite
worked quickly. Once in the Preview app, you can save the image into many
different formats.

Additional info: octave-2.1.55 and octave-forge, Mac OS X 10.3.4.

------ End of Forwarded Message

OK, I got my bmpwrite version image.m to work. I was not appending the .bmp
extension to my tmpnam(), and Preview didn't want to open an unidentified
format. What I'm missing now is a way to pass the correct colormap to
image.m and then to bmpwrite. I tried getting

  colors=colormap();

in image.m which the help files says returns the current colormap, but it
looks like I got the default gray scale instead. Is there an octave variable
that can be referenced to obtain the currently set colormap within a
function? Thanks. 

If I get it to work, I'll send the routine to any Mac user who wants it.

Joe Koski



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]