Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Can anyone recommend a decent C image library?
I'm after loaders for bmp, gif, jpg, png and tga.
I want to use this for programming my Sony Playstation Portable, so opensource would be very handy.
After some googleing I've found FreeImage and CImg, but both feel rather heavy, and CImg is C++ not C.
If you control the images you're loading, the lightest loader I know is Sean Barrett's awesome stb_image.c (direct link to single file source code!).
There are also other very worthwhile libraries on Sean's site such as a tiny TrueType rasterizer and Vorbis decompressor, btw.
If you need OpenGL image loading that uses stb_image, I'll humbly point you to SOILex...
ImageMagick has a C API to connect to its libraries. There's also what they call a "low-level interface" between C and the ImageMagick libraries.
I used FreeImage for PSP games in the past, but it was for pre-processing the data rather than in-game.
DevIL is often recommended. Whether or not it does what you want, I don't know.
I will second Thomas Owens's ImageMagick suggestion. It is mind-boggling just how comprehensive the library is, and how much time it saves you in the end.
Here is some code I wrote for handling images. It is in c++ ( not c ) but you should be able to easily extract the BMP and GIF load code. It's licensed LGPL.
I use the libpng and jpeglib for decompressing those formats.
For one of my project, I am using CImg Library. It's very useful to start with. Moreover, they also have a decent documentations.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last year.
Improve this question
So our teacher taught us to draw circles lines using c in turboc++, and my issue is, this compiler sucks, so I wanted to use some normal compiler or code editor, and I googled it, but those programs on websites which I found, use graphics.h for drawing circle, but my compiler is showing an error named no such file or directory. The same issue is seen when I use an online compiler.
So plz someone guide me where can I find some good material related to basic computer graphics whose c code does not need turboc++. It can be a book or website or videos on youtube.
Thanks in advance.
There is no standard graphics library in C. It's all third party. So you will never be able to write graphics code that's completely portable.
If you're using Linux, it's possible to use libgraph to enable the use of graphics.h. I found a question on askubuntu that covers this: How do I use graphics.h in Ubuntu?
If you're using Windows, it seems to be possible to use WinBGIm to use graphics.h. Geeks for geeks has instructions for how to use it with CodeBlocks https://www.geeksforgeeks.org/include-graphics-h-codeblocks/
I do not know how good these two options are, but they might be worth trying out. That will at least remove the Turbo dependency.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Ideally, I want a library that is similar to the primitive Java2D or Quartz stuff - e.g. setFill, setStroke, moveToPoint, lineToPoint, quadCurveToPoint, fillPath, strokePath, etc. Rotation and scaling of paths would be nice, but not essential. Drawing strings with a proportional font would also be nice. Open source, free as in speech, and free as in beer would be great!
This has to run on an embedded ARM7 with a small color LCD panel. No hardware graphics support. Memory very tight, 20 kbyte RAM and 256 kbyte flash.
Any suggestions?
Take a look at SDL_draw. This library draws on an SDL surface, but you should be able to easily adapt it to draw on the screen of your embedded device. The license is GPL, not sure if that works for you.
I've used the Cairo graphics library in an embedded device. We weren't too worried about memory though.
I don't know how it compares to where you come from, but allegro (mostly for games) is free, easy, and pretty well-supported:
http://www.talula.demon.co.uk/allegro/
Edit: I missed the embedded part. I doubt you want allegro then. Sorry.
openCV might be worth a look. It's more designed for manipulating and diagnosing images rather than to draw them yourself from scratch, but it's open-source, and fairly easy to use.
It's quite fast, so an extra point for embedded systems.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a non-(L)GPL library to decode MPEG-4 stream.
I don't mind it being commercial.
The price is as not important as code quality and support.
Any suggestions are welcome.
Your own experience is even better.
You can only try Commercial ones:
Elcard : http://www.elecard.com/en/download/products.html
Ligos : http://ligos.com/index.php/home/products/mediarig_encoder/
MainConcept : http://www.mainconcept.com/products/sdks/video.html
Rohzet (carbon coder) : http://www.rhozet.com/products.html
Flip factory : http://www.telestream.net/flipfactory/overview.htm
All of these are practically well used in broadcast productions and are of good grade.
The order doesn't reflect any preference. Most of them are either usable as SDK or independent application with dongle or otherwise.
However, your fear is rather fundamental, and fleeing DLL might not be possible to be prevented trivially.
I was under the impression that CoreAVC is by far the best performant H.264 codec. http://corecodec.com/products/coreavc
Depends what you mean by non-GPL. There are many that are LGPL (thus non-viral).
Like the most popular one libavcodec which is part of FFmpeg.
By contrast x264, which is GPL-ed, is only needed for encoding, not for decoding.
FFmpeg makes it clear how to compile it in non-viral way.
Are you going to require your own videocard drivers as well, or what happens if I use a video driver that does whatever I want with what your decoder sends me? Are you going to somehow force users to use only your video cables as well, and somehow destroy any video camera in the vicinity, and wipe clean the users' memories of what they see? Such madness! So what if you use a GPL library? You cannot lock down the Universe.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
What's the simplest C image library for loading and saving? I just want a 2D array to test some algorithms, and built-in functions are not needed.
All these libraries are way too complicated for me. In your place I'd grit my teeth, define an abstraction for a dynamic two-dimensional array, and I'd read and write plain ASCII PNM format.
You could try stb_image for reading and stb_image_write for writing. These are very small libraries.
http://nothings.org/
https://github.com/nothings/stb
Link to my question on gamedev I've got to know about this site:
https://gamedev.stackexchange.com/questions/9083/library-to-load-images-into-textures-linux-c-and-opengl
I think FreeImage is the best one out there:
http://freeimage.sourceforge.net/
Simple Direct-media Layer (SDL) with SDL_image
You could also just read and write raw image RGB values to a binary file, if that is really all you need, and if you know the image size ahead of time.
You definitely want to look at the imagemagik c connector api. It is very easy to get going, and the linked page has some nice code samples.
And there is always the ubiquitous GD library. It is not hard to use either.
I like gd. Real popular.
link text
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I've incorporated LIBPNG and ZLIB into my C software for a microcontroller project due to their nicely liberal license which permits such use without requiring me to disclose any of my code (it's very similar to BSD/MIT/APACHE, but with no attribution requirement).
I'd like to look at using lossy image compression to save memory. The JPEG code I've found is either GPL, LGPL, or not C. I cannot use LGPL, because that still requires me to make it possible for users to replace the library with a newer or different version, which is not possible for this project.
I'm hoping you know of a suitable lossy image compression library. It doesn't have to be JPEG (I control both encoding and decoding) but it does have to be C, and at most BSD licensed or similar (attribution is fine).
-Adam
Try IJG (at ijg.org). It's high-quality JPEG code, written in C, with a BSD-style license. We've used it where I work, and are happy with it.
libjpeg ILJ at is C source and liberally licensed.
http://www.ijg.org/
"We are releasing this software for both noncommercial and commercial use.
Companies are welcome to use it as the basis for JPEG-related products.
We do not ask a royalty, although we do ask for an acknowledgement in
product literature ..."
Mike
+1 on the Independent JPEG Group library.
It's in C
Highly portable
Small footprint
Liberally licensed
Highly regarded
Widely used
Stable (the last release was over 10 years ago )
Both Firefox and IE use IJG code for JPEG browsers. You can't get much better than that.