There is a routine called BYTSCL that will rescale images image pixels from 0 through 255. Therefore, if your image is composed of ones and zeros, and you use the BYTSCL on the image, the ones will be replaced by 255. After you have made this change, you should be able to save the file to a jpeg or png file without too much trouble. For example:
IDL> image1 = [0,0,0,0, $
> 0,1,1,0, $
> 0,1,1,0, $
> 0,0,0,0]
IDL> image1=REFORM(image1,4,4)
IDL> print, image1
0 0 0 0
0 1 1 0
0 1 1 0
0 0 0 0
IDL> image1 = BYTSCL(image1)
IDL> print, image1
0 0 0 0
0 255 255 0
0 255 255 0
0 0 0 0
IDL> WRITE_JPEG, 'test.jpg', image1
|