|
From: Daniel J S. <dan...@ie...> - 2006-06-19 20:59:47
|
Ethan Merritt wrote: > On Monday 19 June 2006 01:19 pm, Petr Mikulik wrote: > >>> `plot "foo" binary filetype=avs with rgbimage` >> >>I wish that gnuplot can read also png images. Usually gnuplot is >>compiled with libpng, so that should not be a problem. > > > It's not quite that simple. AVS is a streaming format. > You can read it one pixel at a time and process as you go. > PNG is much more complicated. I believe that the minimum > you can read at one go is an entire line, and the more > normal operation is to read in an entire image. Furthermore, > there are numerous PNG encoding options, so you have to be > prepared for reading and interpreting a lot of envelope > information. > > And that's before we even get into the whole issues of > truecolor/palette/colorspace/transparency/... > > I honestly think the best way to read in a png image is > to filter it through ImageMagick and generate an AVS stream. > > plot "< convert image.png avs:-" binary filetype=avs AVS is unique in its simplicity, hence writing the code for that was pretty straightforward. Conceptually, any other image format support should move data about in a similar way. However, when we start talking more complex formats then it's best to use existing libraries just like GD for the output terminal side of things. It isn't that difficult, but I think we'd need to devise some method of including only hunks of executable code, just like what has been suggested for the terminal driver. Otherwise gnuplot starts to become bloated. Furthermore, if we go to that extent with images, why should any type of datafile format be excluded from this approach regardless of plot style? Dan |