DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Problem loading alpha transparent PNG images  (Read 16,472 times)

xesenif

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 10
Problem loading alpha transparent PNG images
« on: December 09, 2015, 06:44 PM »
Hi Mouser,

  Thanks for MPQ!  I love it!  I have a directory of alpha transparent PNG files (where the background or other parts of the image are transparent).  Some of these images load correctly (with no background), others with partial background, and others with a white background.  I tried changing many of the settings, but nothing worked.  I don't know if it's an issue with the speed of loading the images, or cropping, resizing, etc.  I like to run MPQ in window mode, but I also had the problem when I ran it as a screensaver.  Is it possible to fix this?  Thanks.

MPQ Screencapture.JPG

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Problem loading alpha transparent PNG images
« Reply #1 on: December 09, 2015, 06:53 PM »
Hmm.. interesting problem and the first time this has come up.. From your sample images it looks like it's not exactly clear what the right thing to do would be.. Would you want an option to set the color to be used for transparent areas? In your case it looks like most of the time that would be white.. but some of your images look like black would be a better choice..

xesenif

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 10
Re: Problem loading alpha transparent PNG images
« Reply #2 on: December 09, 2015, 07:41 PM »
I've attached some PNG (and one transparent gif) files and a screenshot of what they looked like in MPQ on my computer.  All the images have an alpha transparent background, so there shouldn't be a background image box around any of them.  I don't think setting a color to be transparent would help since the images already contain transparency.  Thanks for the quick reply and taking a look at this.

Alpha PNGs.zip (2.5 MB)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Problem loading alpha transparent PNG images
« Reply #3 on: December 09, 2015, 07:44 PM »
Ok so the way i'm interpretting that screenshot is that MPQ is using WHITE in the transparent areas, and that where you see black is actually NON-TRANSPARENT BLACK.  Does that make sense?
And then the fix (for you at least) would be for MPQ to render the transparent areas black.

xesenif

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 10
Re: Problem loading alpha transparent PNG images
« Reply #4 on: December 09, 2015, 07:52 PM »
I think so....for the most part.  Yes, the white areas are suppose to be transparent.  Some of the images however, like with the green link character, and the red boomerang, have some black around them that is suppose to be transparent also.  So some of the images have some of the transparent part filled in.  But yes, basically all the large white areas are suppose to be transparent, and in this case black.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Problem loading alpha transparent PNG images
« Reply #5 on: December 09, 2015, 08:05 PM »
Can you email me a zip file with a few of those transparent pngs that are displaying oddly? (mouser@donationcoder.com)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Problem loading alpha transparent PNG images
« Reply #6 on: December 09, 2015, 08:23 PM »
Pictures received, and i managed to reproduce the problem.  standby, working on it..

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Problem loading alpha transparent PNG images
« Reply #7 on: December 09, 2015, 10:28 PM »
xesenif and I managed to get it fixed; will be in next update.

Original address: https://www.donationcoder.com/forum/index.php?topic=42001.0