From: <jca...@in...> - 2001-11-27 16:05:21
|
On Tuesday 27 November 2001 07:35, Alan W. Irwin wrote: | My motivation here is to have a good-looking demo. Obviously | something is not correct about the current method of reading in | lena.pgm Thus, lets correct it. | since the other parts of the demo show that plimage works | well, and if I look at lena.pgm directly with kview, that is one | heck of a good-looking image....;-) Probably, one could fix up the | current pgm input, but I don't see much point to this reincarnation | of the libpgm library if we can satisfy the valid cross-platform | concerns that you and Joao have expressed another way. There is no such reincarnation of libpgm in x20c.c. libpgm has=20 certainly much more functionalities than just reading "lena". | Thus, Andrew, I like your suggestion for using png format for our | standard input format Do we have a standard [image] input format? That is another issue. As=20 Andrew said, there are two issues here: x20c.c and libplplot. As libplplot currently has no API entries to reading/convert images,=20 x20c.c uses a fast and crude way of reading an image, with the=20 purpose of demonstrate a libplplot API. "lena" is generaly available=20 as jpeg. As I *didn't* want to use libgd to read jpeg, I converted it=20 to ppm, which is simple to read. If we are willing to have image reading/convertion in libplplot, than=20 we must start thinking on what we want, why, implement it, and than=20 recode x20c.c to use and *demonstrate* the new libplplot capabilities. But I don't think that plplot should have such image capabilities, as=20 there are enought good quality libraries for that purpose. Instead,=20 the user will write his program, read the image in whatever format he=20 desires, using the method or library he desires, transformate it in=20 whatever way he desires, and then call plimage() to draw it. Thus, I think that one must correct the x20c.c *demo*, and eventually=20 discuss the image operations to add to plplot. Joao | and using libgd to read it since both are | cross-platform. Also as you point out, on Linux the user can | convert anything to png format using the netpbm package. I have | already used that package in the following way: anytopnm < lena.pgm | | pnmtopng > lena.png. The high-quality result was | indistinguishable from the original even at high magnification. | Thus, I would like to concentrate now on getting proper input of | png images for x20c.c so we can have a good-looking result. | | Now the big question for Andrew: would you be willing to programme | png input to x20c.c using libgd (version 2)? I am willing to do | this myself starting tomorrow using libgd version 2.0.1 that is on | my Debian woody system, but it might take me a while and with your | C skills it might be trivial for you to do. Even if you provide | just the bare bones of the png reading programme, it would help me | get a much quicker start. Let me know what you decide. | | Alan | | email: ir...@be... | phone: 250-727-2902=09FAX: 250-721-7715 | snail-mail: | Dr. Alan W. Irwin | Department of Physics and Astronomy, | University of Victoria, P.O. Box 3055, | Victoria, British Columbia, Canada, V8W 3P6 | __________________________ | | Linux-powered astrophysics | __________________________ | | On Tue, 27 Nov 2001, Andrew Roach wrote: | > At 12:09 AM 27/11/01 +0000, Jo=E3o Cardoso wrote: | > >On Monday 26 November 2001 20:43, Alan W. Irwin wrote: | > >| I have a suggestion. Why not add a function to this demo to | > >| input various image formats and extract the information | > >| required by plimage? Right now, there is rudimentary support | > >| for reading ppm images from x20c.c, and I suggest replacing | > >| this with the appropriate calls to libpbm, libpgm, libpnm, or | > >| libppm. | > > | > >I have no strong objections to that, except that x20c will | > > depend on libraries that may not be available on some other | > > systems. In the first place, unix is not linux, plplot runs | > > also on Macs and MSWindows, and the purpose of a demo is just | > > showing a capability. That's the reason why I spend some time | > > coding the reading of the image, instead of just calling a | > > library. (After all it looks like that I have objections ;-) | > | > I am inclined to agree with Joao here with regards to the | > concerns of having those libraries available on other systems. I | > confess that have never looked to see if libpbm etc... are | > available for DJGPP, thought I expect they would be in some form. | > What would prove more difficult is evoking external image | > converter programs on other platforms. I /personally/ think it is | > perhaps best left as is, with the image command just rendering a | > user-supplied bitmap, and leaving the supply/generation of that | > bitmap up to the user. | > | > However, if we do want to have INTERNAL loading of bitmaps (not | > just user-provided ones) there are some other things to consider. | > | > With respect to linking to libpbm etc... and letting them do the | > image reading, and then using external conversion programs to | > change the format into pbms etc... that almost SETS the preferred | > image format to the pbm family. Why pick that format over any | > others ? It is a very easy one to read in a demo like X20c, but | > isn't necessarily the most flexible or acceptable image format | > out there. There is almost zero use on platforms outside on | > unix/linux. We could just as easily (and perhaps more logically), | > link to libgd, libjpeg, & libpng then read either JPEGs and/or | > PNG images as the "raw format" supported by plplot, using | > external image converters to convert other formats (ie the pbm | > family) to PNGs. In some respect, especially for DOS, windows, | > and MACs, PNGs have more use, flexibility, and acceptance than | > the pbm family. Just a thought... | > | > - Andrew | > | > | > | > | > _______________________________________________ | > Plplot-devel mailing list | > Plp...@li... | > https://lists.sourceforge.net/lists/listinfo/plplot-devel | | _______________________________________________ | Plplot-devel mailing list | Plp...@li... | https://lists.sourceforge.net/lists/listinfo/plplot-devel |