Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 38

Thread: PNG library that works on Win32, Linux and MacOS X...

  1. #11

    PNG library that works on Win32, Linux and MacOS X...

    Quote Originally Posted by cragwolf
    Since you want it to work on Win32, Linux and MacOS X, you're clearly looking for a Free Pascal solution, so Kylix and Delphi support is irrelevant. Doesn't Free Pascal support PNG with the fpimage unit? I haven't tried it outside of compiling and running the associated demo program (see imgconv.pp), but it seems to support transparency as far as I can tell. Also, as far as I can tell it doesn't require libpng, but correct me if I'm wrong. It's part of the FCL, which is poorly documented. You'll have to look at the source code to see what it can do. It's in the fcl/image sub-directory.
    I compile my programs on win32 with delphi, and kylix on other platforms, since so far, delphi still leads the performance for code execution on win32.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  2. #12

    PNG library that works on Win32, Linux and MacOS X...

    Correct me if I'm wrong, but neither Delphi nor Kylix work on MacOS X. So I think I made a reasonable assumption in concentrating the discussion on Free Pascal, which does work on MacOS X. Also I just noticed that this is the Free Pascal forum. I should read more carefully. ops:

    Anyway, I did some testing with the fpImage unit, and found that while it does support the reading of alpha channel information from PNG files, it crashes when you try to write such information. Writing is fine when you don't have an alpha channel. I submitted it as a bug to the FPC guys.

    Personally, I stick with TGA files. This image format is so simple that even someone as dumb as me can create a reader/writer class for it. Compression tends to be 2 or 3 times worse than PNG but I can live with that.
    [size=10px]"In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it's the exact opposite." -- Paul Dirac[/size]

  3. #13

    PNG library that works on Win32, Linux and MacOS X...

    Quote Originally Posted by savage
    Paszlib looks very good, but has not been updated in ages. So that would require that I update it to the very latest version of zlib.
    The paszlib in the Free Pascal SVN is maintained, but not actively developed. But it works very well, is definately usable to read png graphics.

  4. #14

    PNG library that works on Win32, Linux and MacOS X...

    Hi Cragwold, have you tried TPngImage ( pngdelphi.sf.net )? I have tested it across the wholes PNG test suite and it's the only Pascal solution that seems to handle 99% of PNG images. I say 99, but I have actually never seen it mess up an image yet. If we can convince Gustavo to remove his dependency from *.o file and use paszlib for example, it would be a great portable Pascal PNG library.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #15

    PNG library that works on Win32, Linux and MacOS X...

    I tried TPngImage years ago in my Delphi/Win32 days. It was great then, too. This was after I had written my own very inefficient and restricted PNG writer (blood, sweat and tears included). I could never properly understand the Adam7 interlacing business, so I never got quite as far as a reader.
    [size=10px]&quot;In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it&#39;s the exact opposite.&quot; -- Paul Dirac[/size]

  6. #16

    PNG library that works on Win32, Linux and MacOS X...

    I also love the TGA format.. it reads in Delphi, lazarus without problems and full transperency.
    Marmin^.Style

  7. #17

    PNG library that works on Win32, Linux and MacOS X...

    Do RLE-compressed TGA's work on Lazarus? I think Lazarus just uses Free Pascal's fpImage unit, and I recall that unit having trouble with RLE-compressed TGA files.
    [size=10px]&quot;In science one tries to tell people, in such a way as to be understood by everyone, something that no one ever knew before. But in poetry, it&#39;s the exact opposite.&quot; -- Paul Dirac[/size]

  8. #18

    PNG library that works on Win32, Linux and MacOS X...

    Hmm I tried to compile TPngObject on MacOS X and it throws up a few too many errors. Looks like it needs a fair amount of work to allow FreePascal to compile it.
    I've sent emails to Gustavo Daud about making TPngObject more portable, but he is not responding to his email at the moment.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #19

    PNG library that works on Win32, Linux and MacOS X...

    After further investigation I think getting libpng support via a binding will be the most cross-platform way to handle PNG file. It would be great to have a pure Pascal implementation, but the work involved in decoupling GDI specifics from the Gustavo Daud's work, make it prohibitive due to my limited time.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  10. #20

    PNG library that works on Win32, Linux and MacOS X...

    OK I have created a more up to date version of libpng.pas which works with a Win32 DLL called lpng-px.dll. Does anyone else have libpng.so installed on their Linux box that would be able to test my header file?

    I tried to past the code into here, but something is causing it to kill phpBB.
    So you'll have to download the unit from http://jedi-sdl.pascalgamedevelopmen...les/libpng.zip.

    Any feedback/corrections welcome.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •