LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-03-2013, 04:42 PM   #1
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Rep: Reputation: 15
Image Resizing in C


I have RGB images in a C program that I would like to increase or decrease in size. What's the most popular (most likely to be supported) library which will do this?
 
Old 02-03-2013, 06:39 PM   #2
leehanken
LQ Newbie
 
Registered: Jan 2009
Posts: 14
Blog Entries: 1

Rep: Reputation: 7
Quote:
Originally Posted by sysbox View Post
I have RGB images in a C program that I would like to increase or decrease in size. What's the most popular (most likely to be supported) library which will do this?
One option: http://www.imagemagick.org/script/magick-wand.php
 
2 members found this post helpful.
Old 02-04-2013, 11:09 AM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 12,603

Rep: Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677
I would look at the c++ graphics program / lib / header ( it is a bit odd so )
CImg.h

it is a header that is called to do the work in the program
http://cimg.sourceforge.net/

look at the examples
http://cimg.sourceforge.net/screenshots.shtml
 
1 members found this post helpful.
Old 02-04-2013, 11:38 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
ImageMagick has been mentioned : Post #2.

The ImageMagick commands used are convert or mogrify.

$ 'ldd /usr/bin/convert' or $ 'ldd /usr/bin/mogrify'
.. will show that a lot of libraries are used.

Resize http://www.linuxquestions.org/questi...ze-4175435954/

-
 
1 members found this post helpful.
Old 02-04-2013, 07:05 PM   #5
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Original Poster
Rep: Reputation: 15
Thanks, but I'd like a library which does this so I call it from a C program. I'd prefer not to write the image to disk, call the above routines read it from disk, then write to disk, and then read the scaled image from disk.

Does anyone know of a library which will allow me to scale the image from C?
 
Old 02-04-2013, 07:30 PM   #6
John VV
Guru
 
Registered: Aug 2005
Posts: 12,603

Rep: Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677
besides imagemagick

there is a cimg spinnoff Gmic

gmic has replaced Imagemagick for me

and that can be called from a program

http://gmic.sourceforge.net/

it builds on basically every linux , mac, and windows os

or

the "vips" image library
for basic functions like resizing it would be more than is needed
http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS

vips is the backend to the imaging program nip2
see the "libvips" section
http://www.vips.ecs.soton.ac.uk/index.php?title=Libvips
 
1 members found this post helpful.
Old 02-05-2013, 07:45 AM   #7
sysbox
Member
 
Registered: Jul 2005
Posts: 117

Original Poster
Rep: Reputation: 15
Okay, Thanks to all. I ended up looking for image resizing algorithms on the WWW and found several and recoding them for my app. Thank you.
 
  


Reply


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
Resizing partition of an image file galapogos Linux - Software 12 11-26-2008 07:40 PM
image resizing coolb General 4 04-17-2007 12:55 PM
Resizing a loopback image Jehuty Linux - Hardware 5 08-29-2005 10:52 AM
PHP image handling/resizing benrose111488 Programming 1 07-07-2005 02:00 AM
Image resizing algorithms R00ts Programming 1 07-05-2004 12:56 PM


All times are GMT -5. The time now is 10:24 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