png.h RGB-palette conversion help

F

floobles

Hi, I'm trying to obtain the number of colors and possibly the color
table of png files. However, most of my files are RGB (not palette)
mode. Does anyone know how to obtain those info?

I am using the png.h library. I have tried using the png_set_dither
function to convert the rgb mode to palette mode, but did not succeed.
(I would prefer to be able to directly get the info from RGB mode
though.)

Thanks, much appreciated.
 
T

Thomas Matthews

floobles said:
Hi, I'm trying to obtain the number of colors and possibly the color
table of png files. However, most of my files are RGB (not palette)
mode. Does anyone know how to obtain those info?
Have you tried searching the web for the formats of PNG files?
http://www.wotsit.org

I am using the png.h library. I have tried using the png_set_dither
function to convert the rgb mode to palette mode, but did not succeed.
(I would prefer to be able to directly get the info from RGB mode
though.)

Thanks, much appreciated.
Perhaps some people in a graphics group or a group about
your platform could be of better assistance. In this
newsgroup, we discuss issues with the
language, not applications of the language. The language
does not have facilities for graphics or file formats,
so we don't discuss those topics here.

Read the FAQ and Welcome.txt below.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,966
Members
47,516
Latest member
ChrisHibbs

Latest Threads

Top