PNG support lazarus / 8-Other ---------------------------------------------------------------------- vrull · 2008-02-21 22:18 Is there any way to display PNG images properly? So far it looks like they are converted to bitmaps (loosing transparency channel) both in TImage component and Form.Icon property. I am particularly concerned about Lazarus for Linux (GTK 2), as PNG is a native Linux format. I see Lazarus IDE itself has nice icons (cheetah's head), while mine are white squares with damaged image inside. Any suggestions? Thanks in advance. ---------------------------------------------------------------------- Marc · 2008-02-22 10:02 On gtk1/2 there is only support for a 1 bit alpha. PNG supports 8bit alpha channels. Displaying those on gtk1/2 will loose this info. When a PNG is read by lazarus, it is internaly converted to a 8-8-8-8 RGBA bitmap, so no alpha is lost. ---------------------------------------------------------------------- vrull · 2008-02-23 21:03 Thank you, Marc. From my quick investigation of the problem I see, that PNGs are likely converted to RGB + 1bit alpha instead. The rendered images look worse, that their originals (say, icons on the BitBtns with Kind <> bkNone), but not so bad. What wrong is TForm.Icon - no transparency at all, the image should fill the whole square, otherwise it looks just terrible. Maybe you know some way of loading PNGs to preserve their original quality? So far I am not going to perform any image manipulations, just want to know if it is possible to load PNGs, so they were rendered properly. I feel another topic - gdk-pixbuf to TImage is somehow related to my question, but I don't understand a word in what is telling there. ---------------------------------------------------------------------- Marc · 2008-02-25 10:19 Please note that the moment an image is placed in a TBitmap, it gets converted to a format compatible with the screen (on gtk meaning that you only have 1 bit alpha) Having different tbitmap formats then a screen format is not possible atm.