From: Andrew R. <and...@us...> - 2008-02-07 13:53:24
|
Torquil, There are some limitations with the gd driver support for transparency. One of those is that 8-bit doesn't work well. It is generally best to stick to 24-bit truecolor. Having said that, this sounds like it might be a bug to me. I will try to investigate further. Andrew On Tue, Feb 05, 2008 at 09:08:24PM +0100, Torquil Macdonald S?rensen wrote: > Hello, I had this working before but for some reason I now get fully > transparent PNG files, i.e. with no images in them, for all _except_ the first > PNG file I generate. E.g. the program below makes a good 1.png, but > 2.png is just transparent (pnginfo says all the colours used in it are > transparent). I know this because if I use "optimise", it says e.g. "2 > colours, 2 transparent". Everything works fine when not using the 8bit > option. > > Best regards, > Torquil S?rensen > > ********* "pnginfo" has the following to say about 1.png and 2.png: *** > > 1.png... > Image Width: 800 Image Length: 600 > Bitdepth (Bits/Sample): 8 > Channels (Samples/Pixel): 1 > Pixel depth (Pixel Depth): 8 > Colour Type (Photometric Interpretation): PALETTED COLOUR (256 colours, 0 > transparent) > Image filter: Single row per byte filter > Interlacing: No interlacing > Compression Scheme: Deflate method 8, 32k window > Resolution: 0, 0 (unit unknown) > FillOrder: msb-to-lsb > Byte Order: Network (Big Endian) > Number of text strings: 0 of 0 > Offsets: 0, 0 > > 2.png... > Image Width: 800 Image Length: 600 > Bitdepth (Bits/Sample): 8 > Channels (Samples/Pixel): 1 > Pixel depth (Pixel Depth): 8 > Colour Type (Photometric Interpretation): PALETTED COLOUR with alpha (256 > colours, 144 transparent) > Image filter: Single row per byte filter > Interlacing: No interlacing > Compression Scheme: Deflate method 8, 32k window > Resolution: 0, 0 (unit unknown) > FillOrder: msb-to-lsb > Byte Order: Network (Big Endian) > Number of text strings: 0 of 0 > Offsets: 0, 0 > > ****************** Here is the program: ******************** > > #include <plplot/plplot.h> > using namespace std; > > int main() > { > plsdev("xwin"); // Screen plot > plinit(); > plenv(0, 1, 0, 1, 1, -2); > > plsstrm(1); plsdev("png"); // PNG plot > plsfam(1,0,1); plsfnam("%n.png"); > plsetopt("drvopt", "8bit"); > plinit(); > plenv(0, 1, 0, 1, 1, -2); > > double x[] = {0.0, 1.0}, y[] = {0.0, 0.5}; > > plsstrm(0); > plbop(); plline(2, x, y); pleop(); > > plsstrm(1); plcpstrm(0, 1); > plbop(); plreplot(); pleop(); > > plsstrm(0); > plbop(); plline(2, y, x); pleop(); > > plsstrm(1); plcpstrm(0, 1); > plbop(); plreplot(); pleop(); > > plend(); > return(0); > } > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Plplot-general mailing list > Plp...@li... > https://lists.sourceforge.net/lists/listinfo/plplot-general > |