|
From: Daniel J S. <dan...@ie...> - 2005-11-13 09:30:33
|
Ethan A Merritt wrote: > On Saturday 12 November 2005 06:26 pm, Daniel J Sebald wrote: > > >>If >>"convert" created a slightly more sophisticated format that contains the >>array dimensions and data point format, we could support that format. > > > You could write in an AVS input mode. > AVS format is xsize, ysize and then a stream of Alpha/Red/Green/Blue > pixels. > > Attached is a patch for AVS format (*.avs *.x). Here are some sample commands: set datafile binary filetype=auto plot "mandrill.x" binary with rgbimage Let me know how it works with the "convert" script strategy. Information about pixel width, height, image offset, etc. is of course lost using "convert" to avs file format. Those values would have to be specified at the command line if needed. And then there is the issue of monochrome images. [BTW, there may be a bug in the binary code. The command plot "mandrill.x" binary format='%*uchar%uchar%uchar%uchar' u 1+2+3 with image should work. But it doesn't seem to be doing the expected thing. I'll look for this later.] This comes with a no warranty. It is a start and I can do more in the future, but near term I'm very busy. If you have some tweaks, let me know. I used the test image at: http://astronomy.swin.edu.au/~pbourke/dataformats/avs_x/ and it looks correct, except I don't if the x-axis direction is correct. If you have images that you know after passing through convert come out the wrong x-direction, the following line of code in the patch: df_bin_record[0].scan_dir[0] = 1; should be changed to df_bin_record[0].scan_dir[0] = -1; Dan |