Doubts about PNG 32 bit

hechelion

Member
Hi.
I read a lot of comments that Openbor supports 32 bit PNG and GIF but I can not get them to work well.

Today I was doing tests and it was impossible for me to use a 32bit PNG or GIF for the levels panels and for the sprites of the characters.
32bit PNG or GIF only work for baground, apparently.

the level has a single panel that I charge as follows:
panel  data/levels/nivel_inicial/panel_a.png  #32bit png.  Openbor Crash "Error loading file 'data/levels/nivel_inicial/panel_a.png'"
panel  data/levels/nivel_inicial/panel_a.gif  #32bit gif .  Work, but I have problems with the color in game.
panel  data/levels/nivel_inicial/panel_a.gif  #8bit gif .  Work perfect.

I had the same problem when I tried to use PNG as a character's sprite.

I try with 2 different OS and different Openbor version and have the same issue alway.
OS: windows 10 64 bit.
Openbor: v3.0 Build 3854

OS: Kubuntu 16.04 64 bit
Openbor: Compiled today.



Can used a 32bit GIF or PNG for a panel or character sprite?

PD: excuse my poor english

PPD:I already tried with this options in video.txt:
video 800x450 and video 1
colourdepth 32bit and colourdepth 16bit

PPPD: The same issue with Build_5679
 
High colour is only supported for background images (loading and menu screens) nothing ingame.
 
msmalik681 said:
High colour is only supported for background images (loading and menu screens) nothing ingame.

That's not true. High color is supported for any image asset. Not sure what the problem is here, but we can take a look.

Incidently, OpenBOR supports 24bit png, not 32. There's no such thing as a 32bit gif at all, and a 32bit png is just 24bit color with an alpha channel added. Alpha channels, tinting, blending, and so on are all supported at the rendering level instead. It's much less resource intensive and a lot more versitle. See here for more details.

DC
 
24bit png works fine, just tested it as background layer, you want alpha channel working ? IN this case its quite a hassle at the moment, you need separate alpha image
http://www.chronocrash.com/forum/index.php?topic=3781.msg52010#msg52010
 
I read a lot of comments that Openbor supports 32 bit PNG and GIF but I can not get them to work well.
The engine indeed supports 32bit (in fact, 24bit + an 8bit alpha image) and indeed support GIF

PPD:I already tried with this options in video.txt:
video 800x450 and video 1
colourdepth 32bit and colourdepth 16bit
Colourdepth is ignored since many builds ago. It doesn't care what depth you choose, the engine will convert it.

and a 32bit png is just 24bit color with an alpha channel added
Yes, what it makes it 32bit. Transparency is the remaining 8 bits. 24Bit PNG = 8 bits red, 8 bits blue, 8 bits green. 32bit PNG = 8 bits red, 8 bits blue, 8 bits green, 8 bits alpha, according to the PNG authors.

wow I did not know that !
This is possible since long time ago. Even for fonts, where you can use alphamask too.
 
O Ilusionista said:
Yes, what it makes it 32bit. Transparency is the remaining 8 bits. 24Bit PNG = 8 bits red, 8 bits blue, 8 bits green. 32bit PNG = 8 bits red, 8 bits blue, 8 bits green, 8 bits alpha, according to the PNG authors.

Right, I'm just trying to make clear why we support 24bit .png but not 32. The functionality added by 32bit images vs 24bit images is already built into OpenBOR. And a lot more on top of it. It would be a waste of time and resources to support 32bit image files.

@hechelion, think we found the problem - you were using 32bit png instead of 24bit, right? That's not supported. See above - all 32bit adds is an alpha channel, and OpenBOR does that for you in real time. Some of the options available to you are...

  • RGB channel levels - Adjust color level of Red, Green, and Blue outputs.
  • Preset alpha blends - There are six preset blending mixes you can choose from, just toggle a flag and you're done. These cover anything you will have seen in a 2D game up until present day.
  • Custom alpha blend - This is the equivalent to alpha channel in a 32bit png. 0 (transparent) - 255 (opaque).
  • Alpha mask - This is what bwwd was talking about above. It is tedious, but gives you blend control over pixels individually as opposed to the whole image.
  • RGB overlay - Overlays a color mask onto an image, in turn subject to any of the blending modes here, plus scaled, distorted, etc.. This is how you can tint images for fire effects, glowing (think Gill from SFIII, or the back-lighting effect from CVS I) or whatever else.

Why don't you let us know the effect you're going for, and we'll guide you from there.

DC

 
thanks to everyone.

I tried with a 24 bit PNG but still crash openbor.

File info:
panel_a_24.png: PNG image data, 1600 x 458, 8-bit/color RGB, non-interlaced

Openbor log
Code:
********** An Error Occurred **********
*            Shutting Down            *

Error loading file 'data/levels/nivel_inicial/panel_a_24.png'Total Ram: 8262934528 Bytes
 Free Ram: 5399793664 Bytes
 Used Ram: 77401088 Bytes

Release level data...........
Level Unloading: 'data/levels/nivel_inicial/inicial.txt'
Total Ram: 8262934528 Bytes
 Free Ram: 5399793664 Bytes
 Used Ram: 77401088 Bytes

RAM Status:
Total Ram: 8262934528 Bytes
 Free Ram: 5399793664 Bytes
 Used Ram: 77401088 Bytes

Done!

Release graphics data........	Done!
Release game data............

Unload 'test' ............Done.

Release game data............	Done!
Release timer................	Done!
Release input hardware.......	Done!
Release sound system.........	Done!
Release FileCaching System...	Done!

**************** Done *****************

Error loading file 'data/levels/nivel_inicial/panel_a_24.png'

I tried the same image (panel_a_24.png) but rename it to data/bgs/tileb.png  and work without problems.

Here I leave the images that I am trying to use:
panel_a_32.png: PNG image data, 1600 x 458, 8-bit/color RGBA, non-interlaced
panel_a_24.png: PNG image data, 1600 x 458, 8-bit/color RGB, non-interlaced
https://mega.nz/#!Xh8QSYRI!YI-vd59rzXrRjoQP-uvRJkuI1MvS712i0YtTRQZWcXE



Damon Caskey, I'm started a new project and have the idea to move all the graphics asset to PNG. But I thing I come back to 8bit gif, because I never have an issue with this format.

thanks to everyone for your time.
 
dont use so long folder names and long filenames, thats the first suspicious thing, its a good habit to not create filenames longer than 8 digits
 
bWWd said:
dont use so long folder names and long filenames, thats the first suspicious thing, its a good habit to not create filenames longer than 8 digits

That's really not true anymore.  It's never a good idea to be wasteful with anything including filename length, but OpenBOR ditched the 8.3 limitation from its DOS roots a long time ago.

DC
 
Yup, 24bit pngs dont work for backgrounds, just for titlescreens which is superstrange ?
Tried to use the same image for background, and engine crashed, log said usual stuff about it not being indexed
b1fb3f52.png
 
I don't know what you guys are doing. I just now saved a pic of my bike as 24bit .png and replaced my beach background with it. Runs without any problems at all.

 

Attachments

  • bor - 0013.png
    bor - 0013.png
    136 KB · Views: 36
  • back0001_b.png
    back0001_b.png
    456.6 KB · Views: 30
that bike file crashed as well, i have openbor exe  in e:/openbor folder.
background data/bgs/bike.gif  0.5 0.8 0

Code:
Error loading background (PIXEL_x8/PIXEL_32) file 'data/bgs/bike.gif'
i changed name when saving to disk
what engine version it is ?
 
bWWd said:
that bike file crashed as well, i have openbor exe  in e:/openbor folder.
background data/bgs/bike.gif  0.5 0.8 0

Code:
Error loading background (PIXEL_x8/PIXEL_32) file 'data/bgs/bike.gif'
i changed name when saving to disk
what engine version it is ?

Why did you change the name .gif? That can't possibly work.  :o
 
You see, this is why i like this forum,  im a noob and theres no excuse.
That's exactly it, i just changed filenames , did not bother to change gif to png  ::)
Thanks a lot! Works now and with my pngs too.
I changed it when saving cause it was faster but forgot extension.
 
Hi @DCurrent, I try to use your bike image as a panel but I received the following error:
Error loading file 'data/bgs/back.png'
Here my video.txt:
Code:
video 6 colourdepth 32bit
I wish to make a try with png24 files for hires images. Is anyone can show me how they deal with this kind of images? Thanks for your great help :)
 
Hi @DCurrent, I try to use your bike image as a panel but I received the following error:

Here my video.txt:
Code:
video 6 colourdepth 32bit
I wish to make a try with png24 files for hires images. Is anyone can show me how they deal with this kind of images? Thanks for your great help :)

First, get rid of colodepth 32. That doesn't do anything any more and hasn't for years. OpenBOR is 32 bit mode only.

As for the image, there's no trick or special technique. That's the whole point. You just save the image as a 24bit .png, and use it. Post your text and image here if it is giving you problems.

DC
 
Thanks Damon, here is the background that I wish to use as a panel:
...

Don't see any issue with the image. I know that you can use 24bit .png as a layer, but can't recall if you make it a panel or not. I'm not where I can dig through the source code to find out. If it isn't working as a panel, try it as fglayer.

Edit: Confirmed - Panel does not support 24bit png. You'll need to make it the background or a layer.

DC
 
I am trying to put this image into the game as a 24bit PNG

I want to use it as a background, using it in CRTDude's Story System using the _back command.

Unfortunately it does not load the image (no crash though, it just doesnt appear)

I tried to use the same image and stick it into the game as a stage background, but it crashed

back_lowflip.png
 
Back
Top Bottom