# XnView How to change file read-in format

image-viewer

I have a "raw file" (not unprocessed image data, but raw heightmap data from a game's map editor saved as Photoshop RAW) and it looks like XnView might be able to open it.

It sees the properties as 513×513 8-bit RGB when in reality it is a 513×513 single channel 16 bit file with IBM PC byte order and no header. How do i force it to read it this way?

• Convert it with imagemagick to format XnView can read.

I can be difficult to preserve the 16 bit depth however. You will have to find a suitable format that can represent the depth and can be exported by imagemagick and imported by XnView.

As a start I would try TIFF, it supports 16 bit and is supported by imagemagick as well as XnView. The conversion will blow up the single channel into three channels with identical values.

To read you file in imagemagick you'll probably have to use the following options:

     GRAY   Raw gray samples
Use -size and -depth to specify the image
width, height, and depth.


Try:

convert -endian LSB -size 513x513 -depth 16 gray:image image.tiff


Convert back to 16 bit single channel:

convert image.tiff -depth 16 -type grayscale gray:image