locked
Color Problem. PNG vs. GIF, Firefox vs. IE. (GDI+) RRS feed

  • Question

  • User1900948409 posted
    hi all.

    i'm programmatically making some menu images using system.drawing. i was making png images and they were working brilliantly in firefox and then i viewed them in IE and ick. the problem is, IE doesn't display png colors correctly. i'm not talking about the known alpha channel transparency problem, i'm talking about basic colors. for example, make an image, fill the background with a color, let's do something easy, say #444444 (that's Color.FromArgb(68, 68, 68)) and then put that image in a table cell that has a BackColor property of #444444. looks fine in firefox, doesn't look so fine in IE. open the image up in photoshop and compare. in photoshop the image is correctly colored, so the image is created correctly.

    given that, i decided i'd bite the bullet and try to make some gif images. however, because gif uses a reduced palette my colors were bollixed up. dithered to be more precise. however, you can specify the colors in a gif palette. problem is, how do you do this in .net? it's easy in photoshop. :)

    so, i have two questions really:
    1) is there a way to make IE display the png colors correctly? maybe it's related to the transparency issue and you have to set something??

    2) is there a way to specify your color palette when saving a gif image? i thought maybe it would be in the encoder options, but i didn't see anything.

    ack, stupid IE.
    Wednesday, July 5, 2006 11:27 PM

All replies

  • User-1029435529 posted
    2) is there a way to specify your color palette when saving a gif image? i thought maybe it would be in the encoder options, but i didn't see anything.
    I don't know about specifying the color palette, but you can introduce the equivalent of Photoshop's Adaptive palette for GIF images.  Please refer to Optimizing Color Quantization for ASP.NET Images.
     
    Thursday, July 6, 2006 2:23 AM
  • User1900948409 posted
    yeah, found that last night, it's working brilliantly.

    still wish IE did ping properly though. :)
    Thursday, July 6, 2006 12:49 PM