H
hamishd
Does anyone know of a good library (free or otherwise) for creating
PNG or JPEG images?
Apologies if OT.
PNG or JPEG images?
Apologies if OT.
hamishd said:Does anyone know of a good library (free or otherwise) for creating
PNG or JPEG images?
hamishd said:Does anyone know of a good library (free or otherwise) for creating
PNG or JPEG images?
You can take a look at this:http://www.graphicsmagick.org/
but these two image types are so common, that I am sure you can find at
least several more libraries (just if you try).
Well, you could try to use libpng and libjpeg (both of which are C
libraries) directly,
but they are quite complicated to use and require
a significant amount of documentation reading before you can do anything
with them.
Well, you could try to use libpng and libjpeg (both of which are C
libraries) directly, but they are quite complicated to use and require
a significant amount of documentation reading before you can do anything
with them.
(Side note: these are the more or less the reference implementation of
those file formats, in very wide use at least on Unix systems.)
I haven't used them (just libpbm), but can it really be that bad? I
look at e.g. John Bradley's 'xv', and see his WritePNG() function,
which uses libpng, is at just below 400 lines ... but 100 of those are
for text comments and many of the others are for various image depths.
I suspect that much of the trouble will come from converting your
internal representation of the image to what the library wants.
Which brings another question: does hamish have the internal part done
already, or is he maybe even asking for a complete 2D drawing package,
not just the encoding?
I have a set of polygons, which I draw to the screen. But I also want
to draw these to a PNG file. I want to be able to create line-
segments, and possibly fill the polygon with a colour.
These images will be displayed in a web-browser, and it has been
suggested that PNG is the best format for scaling / adjusting to
window size.
I have a set of polygons, which I draw to the screen. But I also want
to draw these to a PNG file. I want to be able to create line-
segments, and possibly fill the polygon with a colour.
These images will be displayed in a web-browser, and it has been
suggested that PNG is the best format for scaling / adjusting to
window size.
Juha Nieminen said:Well, you could try to use libpng and libjpeg (both of which are C
libraries) directly, but they are quite complicated to use and require
a significant amount of documentation reading before you can do anything
with them.
hamishd said:I have a set of polygons, which I draw to the screen. But I also want
to draw these to a PNG file. I want to be able to create line-
segments, and possibly fill the polygon with a colour.
These images will be displayed in a web-browser, and it has been
suggested that PNG is the best format for scaling / adjusting to
window size.
hamishd said:Does anyone know of a good library (free or otherwise) for creating
PNG or JPEG images?
Apologies if OT.
Jorgen Grahn said:I haven't used them (just libpbm), but can it really be that bad? I
look at e.g. John Bradley's 'xv', and see his WritePNG() function,
which uses libpng, is at just below 400 lines ... but 100 of those are
for text comments and many of the others are for various image depths.
Richard said:I disagree with your assertion that it takes reading significant
documentation before doing anything with them.
Well, you don't have to take my word for it. You can check the
documentation yourself:
hamishd said:Does anyone know of a good library (free or otherwise) for creating
PNG or JPEG images?
[...] (the fact that
you sat down and figured it out a decade ago is commendable, but it
doesn't change the basic point - that you shouldn't have *had* to really
figure it out).
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.