Can I save the image object into hard disk?

edited June 2014 in Ruby Scripting
Hi Matthias

I got an Image object in the following scripts:
------------------
img = RBA::Image.new(ncolumns, nrows, data)
img.pixel_width = xw
img.pixel_height = yw
img.trans = RBA::DCplxTrans.new(1.0, 0.0, false, RBA::DPoint.new(xmin, ymin))
------------------
Can I save the img into hard disk in some format? I cannot find a save method for Image object in the documents.

Thanks

Comments

  • edited November -1

    Hi,

    the Image class was intended to background images, so you can load an image but not save it currently. That's what I meant in the other forum entry.

    In addition the Image class provides functionality somewhat beyond the capabilities of the normal image formats - for example, floating-point pixel data.

    You can use Image#get_pixel to get the pixel data for individual pixels but next thing is you have to find a way to write them to some file. If you want a text file that is straightforward and can by done within Ruby.

    Matthias

  • edited November -1
    I think I got your point. Thanks a lot, Matthias.
Sign In or Register to comment.