LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-14-2011, 09:27 AM   #1
agemo
LQ Newbie
 
Registered: Sep 2008
Posts: 9

Rep: Reputation: 0
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).

Last edited by agemo; 05-16-2011 at 10:48 AM.
 
Old 05-14-2011, 01:51 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Perhaps imagemagick would do?

http://www.imagemagick.org/script/ap...f31u7hmljf7vq5
 
1 members found this post helpful.
Old 05-14-2011, 11:45 PM   #3
ravi.xolve
Member
 
Registered: Jul 2006
Posts: 89

Rep: Reputation: 15
There are various imaging libraries available. libPng is one of the most used. if you are using Python try PIL.
 
Old 05-15-2011, 01:16 PM   #4
tc_
LQ Newbie
 
Registered: Sep 2010
Location: Germany
Distribution: Slackware
Posts: 28

Rep: Reputation: 30
Question 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
 
Old 05-15-2011, 03:36 PM   #5
skykooler
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 84

Rep: Reputation: 17
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.
 
Old 05-16-2011, 06:45 AM   #6
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 230Reputation: 230Reputation: 230
Quote:
Originally Posted by David the H. View Post
Perhaps imagemagick would do?...
My 1st thought, too.
 
Old 05-16-2011, 08:48 AM   #7
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,631

Rep: Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429Reputation: 1429
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?

Last edited by dugan; 05-16-2011 at 08:50 AM.
 
Old 05-16-2011, 08:53 AM   #8
SigTerm
Member
 
Registered: Dec 2009
Distribution: Slackware 12.2
Posts: 379

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by agemo View Post
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.
 
Old 05-16-2011, 10:48 AM   #9
agemo
LQ Newbie
 
Registered: Sep 2008
Posts: 9

Original Poster
Rep: Reputation: 0
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!
 
  


Reply

Tags
image, libraries, png


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Pasting a png image on another through CAIRO library TheIndependentAquarius Programming 5 03-06-2010 03:22 AM
convert image.png image.jpg changing colours MikeyCarter Linux - Software 1 11-17-2006 10:16 AM
PNG library WorldBuilder Linux - Software 7 01-01-2006 12:28 AM
Webalizer: configure: error: png library not found... please install png. mikeshn Linux - Software 5 01-10-2005 02:28 PM
jpeg and png library for gd upr8830 Linux - Software 4 06-11-2003 04:49 PM


All times are GMT -5. The time now is 12:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration