i run this code


then it show error like this

AssertionError: _num_channels >=1 && _num_channels <=4 at line 92 of

the thing is
i want to use OnscreenImage fn

minimap = OnscreenImage (image = ‘models/mapworld.png’, scale = 0.5)
it show error that attribute image must be texture, not nontype

help me plz
i want to show image 2d to my game

Hm. I just tried the same thing — not using your image of course, I’m using a different one — but I don’t get the same assertion error. I am using 1.4.0, though. Do you get the same error with 1.4.0?


I assume you’re trying the build a minimap like in the file you downloaded today from the Showcase section.

You are welcome to use the minimap class I wrote. You just change out the background image and anything else you need. You don’t need to write it over again unless you just don’t like how it works.

The PMNImage() function was pretty buggy when I was working with it also. The reason I wanted to use PMNImage instead of something easier like onscreen image or making a texture card was that I wanted to have the actual graphic of the minimap (the landscape) change as time passed. You may not find that necessary for your program.

I would check a couple of things:

  1. Make sure that in the folder where your .py file is located that you have a folder called “models” and that inside that folder you have an image called “mapworld.png”

  2. You need to have a line like

from pandac.PandaModules import * 


from pandac.PandaModules import Filename

as well.

Based on the errors you wrote I’d bet it’s the first problem (#1).

:slight_smile: thanks a lot

Josh Yelon

sorry i’m don’t know
:confused: i not upgrade to 1.4.0 yet

This error message:

AssertionError: _num_channels >=1 && _num_channels <=4 at line 92 of

Simply means that it was unable to load the image file altogether. You must have specified an invalid path to the texture file.


:slight_smile: yes David

b’cos i use program paint save picture to .png file
panda3d can’t read it and show that error
i don’t know why?

when i use program adobe photoshop save it to .png file
the code is work

555 :open_mouth: so confuse

I’m not sure, but I think its because of the fact Paint saves png files normally with .PNG - capital letters in the extension. Panda3d paths are case-sensitive. Perhaps that’s the reason…