Results 1 to 6 of 6

Thread: Importing 256 color (paletted) images results in grayscale..

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Importing 256 color (paletted) images results in grayscale..

    It's ugly, but true. To save space I've been using PNG-8 formatted images to save my work. There's no real loss in quality by using it except when importing that information. When I import the image to edit the tiles and frames in it the image is a very ugly grayscale.

    Anything you can do to fix that?

  2. #2

    Importing 256 color (paletted) images results in grayscale..

    Use a better image editing package. Personally ArtWeaver does a good job of working with PNG8 files. There are other products out that allow you to easily edit PNG8's as well, ArtWeaver just had the best feature set for the buck (free) when I was looking.

  3. #3

    Importing 256 color (paletted) images results in grayscale..

    You're misunderstanding the problem.

    I use Adobe Photoshop 7 and have exported to a perfectly valid PNG-8 file. Firefox, IE, and even Windows' crummy image previewer all show it correctly. But when I import it into Phoenix's image editor to set up my tiles and "slices" of the image for frames the file isn't loaded correctly.

    Hence my question to Andreaz possibly fixing the loading problem. His tool ignores the palette and treats the image as a grayscale image, which it most certainly isn't (in this instance).

  4. #4

    Importing 256 color (paletted) images results in grayscale..

    That is some limitations in the freeimage loader in such cases, i'm just using the raw 32bit texture data it provides. My guess is that it doesnt support palleted png's.

    You can write you'r own loader by extending the TPHXTextureManager class if you have code to load PNG-8 with palette functionality.

    It doesnt matter if the imageeditor show the images incorrectly if you have working code for loading the images in the game. The image format in phx just appends the original image to the new file and thus there's no format change.
    Amnoxx

    Oh, and this code appears to be an approximate replacement for return(random() & 0x01);

    Phoenix Wiki
    http://www.phoenixlib.net/

    Phoenix Forum
    http://www.pascalgamedevelopment.com/viewforum.php?f=71

  5. #5

    Importing 256 color (paletted) images results in grayscale..

    You could try if pngimage could load palette.
    http://pngdelphi.sourceforge.net/

  6. #6

    Importing 256 color (paletted) images results in grayscale..

    Quote Originally Posted by Andreaz
    That is some limitations in the freeimage loader in such cases, i'm just using the raw 32bit texture data it provides. My guess is that it doesnt support palleted png's.

    You can write you'r own loader by extending the TPHXTextureManager class if you have code to load PNG-8 with palette functionality.
    I've writen TPHXTextureManager that uses Imaging instead of FreeImage a while ago. Supports all PNG formats, maybe you'll find it useful.

    http://galfar.vevb.net/temp/phx/phxTexture.pas
    (Uses some older Phoenix but I guess TPHXTextureManager haven't changed since then)
    Vampyre Imaging Library
    Earth Under Fire (PGD Big Boss 3rd place)
    Domains Of Chaos (PGD Multiplexity 5th place)

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
  •