LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Recommend a simple png-supporting image library (https://www.linuxquestions.org/questions/programming-9/recommend-a-simple-png-supporting-image-library-880709/)

agemo 05-14-2011 09:27 AM

Recommend a simple png-supporting image library
 
Hello, I want to build a simple OCR program and I was wondering what library to use. The images are saved on my hdd as colour .png files, i won't be using any effects on them but I will be working with pixels a lot, so direct access to them would really be great.

So I was curious if there's a lib that provides direct access to individual pixels and pretty much nothing else (libpng, devIL or QImage from qt are all good but each has it's downfalls).

David the H. 05-14-2011 01:51 PM

Perhaps imagemagick would do?

http://www.imagemagick.org/script/ap...f31u7hmljf7vq5

ravi.xolve 05-14-2011 11:45 PM

There are various imaging libraries available. libPng is one of the most used. if you are using Python try PIL.

tc_ 05-15-2011 01:16 PM

Perhaps overkill for your app
 
I don't know if the library classifies as ''simple'', but did you have a look at GIL from Adobe? It can read png files and you may access single pixels... However, there is a lot more included in that library, so I don't know if it fits your needs.

The URL is
http://www.boost.org/doc/libs/1_46_1...doc/index.html

Cheers
Tobias

skykooler 05-15-2011 03:36 PM

I would suggest PIL if you are using Python, I haven't worked with PNGs with any other language so that is all the help I can offer.

archtoad6 05-16-2011 06:45 AM

Quote:

Originally Posted by David the H. (Post 4356390)
Perhaps imagemagick would do?...

My 1st thought, too. :)

dugan 05-16-2011 08:48 AM

I hesitated to suggest cimg, because it doesn't fit the "almost nothing else" requirement, but I'll throw out out anyway.

So what did you feel were the "downfalls" of the libraries you listed?

SigTerm 05-16-2011 08:53 AM

Quote:

Originally Posted by agemo (Post 4356243)
Hello, I want to build a simple OCR program and I was wondering what library to use. The images are saved on my hdd as colour .png files, i won't be using any effects on them but I will be working with pixels a lot, so direct access to them would really be great.

So I was curious if there's a lib that provides direct access to individual pixels and pretty much nothing else (libpng, devIL or QImage from qt are all good but each has it's downfalls).

You should explain what exactly you didn't like about libraries you listed. QImage, for example, is pretty decent and allows manipulation of individual pixels. There's also SDL_image, but it is supposed to be used in SDL applications only.

agemo 05-16-2011 10:48 AM

thank you for your replies!
After searching a bit a decided to settle with imagemagick.

and as for the other libraries, it's just a personal thing:
libpng has a pretty hard-to-work-with API, so png++ would've be better since I was going to build a wrapper for libpng anyway
QImage, required QT and I don't think it would've been the best decision to add libqt as a dep for just it's image library
devIL was my second choice after png++ but even though it has an easier API, it's still in C from what I saw, so again I would've needed to build a wrapper (not that I don't like C or anything, it's just I feel like code is more organized when you use OOP)
PS: I don't have anything against any library, but I wanted something simple for my first image-manipulation program
cheers!


All times are GMT -5. The time now is 03:45 PM.