GLBasic forum

Main forum => GLBasic - en => Topic started by: Ian Price on 2009-Nov-23

Title: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Nov-23
I'm not sure if this is a bug but I've recently had to buy a new laptop (old one went bang - literally, with sparks and smoke!) and it came with Windows 7.

I created a .PNG for a game and found that the magenta mask - RGB(255,0,128) showed in-game. The same image in .BMP format displayed fine, without the magenta mask.

I've attached two images - one .PNG and one .BMP - can someone try these in GLB please, as I'm not sure if it's a GLB or Windows 7 problem.

The images were created in MS Paint (yes, I know, but I like it). Maybe the new update to MS Paint has altered the way .PNGs are saved or maybe I've done/not done something to cause the problem.

Any ideas?

[attachment deleted by admin]
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Hemlos on 2009-Nov-23
bmp is masking out.
png isnt masking.

screenshot description:
white setpixel in upper left corner of images
screenshot using grabsprite



[attachment deleted by admin]
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Moru on 2009-Nov-23
Code (glbasic) Select
LOADSPRITE "Media/conveyor2.bmp", 1
LOADSPRITE "Media/conveyor2.png", 2

ALPHAMODE -.99
DRAWSPRITE 1, 0,0
DRAWSPRITE 2, 10,0
SHOWSCREEN
MOUSEWAIT
END


First is totaly invisible, second (the png) you can see the pink color and read the "Hi!"

If I load the png into photoshop and save it normally I still get the same result but if I save for the web and activate transparency, then it works as expected. (they both disappear, if you paint background white you get two "Hi!")
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Nov-23
Those results are as I expected. MSPaint on Windows 7 is doing something odd with the .PNG.

Cheers chaps.

Gernot, would you be able to include an update that deals with these .PNG issues? I'm not the first to notice this - see Phil's post here - http://www.glbasic.com/forum/index.php?topic=3811.0

[EDIT] Yep, it's definitely something up with MS Paint - I loaded a working .PNG (with magenta mask) and saved it again and the magenta mask showed through.

[EDIT 2] MS Paint now saves .PNG files as 32bit rather than the previous 24bit.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Hemlos on 2009-Nov-23
Quote
[EDIT] Yep, it's definitely something up with MS Paint - I loaded a working .PNG (with magenta mask) and saved it again and the magenta mask showed through.

[EDIT 2] MS Paint now saves .PNG files as 32bit rather than the previous 24bit.

Can you just fill the area needing the correct color, then resave, to make it work?

32bit mspaint: is this a windows 7 program?
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Nov-23
Quote from: Hemlos on 2009-Nov-23
Quote
[EDIT] Yep, it's definitely something up with MS Paint - I loaded a working .PNG (with magenta mask) and saved it again and the magenta mask showed through.

[EDIT 2] MS Paint now saves .PNG files as 32bit rather than the previous 24bit.

Can you just fill the area needing the correct color, then resave, to make it work?

32bit mspaint: is this a windows 7 program?


1. Nope.

2. Yep. From my first post -
QuoteMaybe the new update to MS Paint has altered the way .PNGs are saved or maybe I've done/not done something to cause the problem.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Nov-25
So Gernot: Any hope of implementing 32bit .PNGs like the recent .32bit .BMP update?
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Kitty Hello on 2009-Nov-25
a 32 bit PNG has an alpha channel. If MS Paint saves it w/o the alpha information, it's dumb.

Dear MS, could you please stop wating my precious time with your updates that always constantly *love* things up!?
thank you.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Nov-25
Apparently MSPaint does/can use alpha now, but I haven't worked out how yet.

SoundRecorder and MSPaint on Windows7 are both shite. I've actually grabbed both those apps from earlier Windows to use. It's not a big deal, but you know that this issue will come up again.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Kitty Hello on 2009-Nov-25
Problem with old MSPaint is, that it saved edited 32 bit png images with 32 bit, but leaves the alpha bits totally out. :(
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Nov-25
If you look at the info on an old MSPaint .PNG it saves as 24bit, not 32bit.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Kitty Hello on 2009-Nov-30
Open a 32 bit PNG, and save in the old paint (vista) - it's still 32 bits.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Dec-01
Ermm... No it's not. I'm doing that. MSPaint from XP saves as 24bit. And there's no problem then.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Kitty Hello on 2009-Dec-01
I need a copy of the XP Paint then. Thanks a very lot. It also has the pink colour in the palette. Vista sucks big time.
Title: Re: Windows 7 RGB(255,0,128) .PNG problem
Post by: Ian Price on 2009-Dec-01
Check your email Gernot :)