Jump to content
  • Advertisement
Sign in to follow this  
Say

color palette and png

This topic is 4715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Can i use in my game a pcx file with a separate palette at the place of png files that include palette information. In this way i have just one palette for all the images i use, good for make free space. So?

Share this post


Link to post
Share on other sites
Advertisement
You could use a big png with all the sprites in it. That's a frequent approach. I don't know about the support for pcx files, though.

Share this post


Link to post
Share on other sites
PCX files also include palette information. If you want to seperate palette information from the indexed images, you'll need to use a custom image format.

Share this post


Link to post
Share on other sites
Yeah, you're desired approach would probably be to look into treating a high resolution image as a collection of several lower resolution images. Design-wise, it's fairly easy to abstract this out. Just make sure your image class knows if it's part of a larger image or just a single logical image.

Share this post


Link to post
Share on other sites
You can do that, but there will be no built-in support in the MIDP libraries. You'll need to write your own image incoder that can take pixel data and palette data and create a byte array in a valid png format.

If you only need one palette then having one big image (like Blew suggested) will solve your problem and be easier, but if you have different palettes (for example, in sports game where you want to use the same pixel data with different palettes for the different teams) then making a png encoder will be useful.

shmoove

Share this post


Link to post
Share on other sites
Right. That's what I was getting at as well. I was just suggesting that abstracting all that in the implementation is a nice way to handle "one big image". =)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!