LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-25-2006, 06:15 AM   #1
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Rep: Reputation: 30
Image manipulation library for console?


Hi!
I want to create image manipulation plugin for my website, but I want to create it as consule application, not GUI! My plugin will add graphic filters to uploaded images and saves them. I want to write this in C. Does anyone know any library etc..? Thank you!
 
Old 03-25-2006, 07:32 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You might want to look at ImageMagick-devel.

Also, look into the interfaces for ImageMagick, such as C, Perl, PHP, and Ruby. It may not be necessary to write your own C code to do what you want to do.
 
Old 03-25-2006, 07:36 AM   #3
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
And the unruly twin to ImageMagick is GD2.
 
Old 03-25-2006, 05:06 PM   #4
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks! But aren't there standart image manipulation libraries? or something that I can #include in my C code?
 
Old 03-25-2006, 06:03 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Image Magick *is* a standard image manipulation library.

And you *can* include it in your C code.

Or C++ code. There are also ImageMagick bindings to Perl, Python and many other languages.

Oh - and it has a CLI that you can script from bash (on Linux) or even a .bat file (on Windows)!

It's great, it's incredible, it's easy to use, it's powerful, it's flexible.

Do you kind of get the impression I like ImageMagick?

I think you will, too!

Last edited by paulsm4; 03-25-2006 at 08:33 PM.
 
Old 03-25-2006, 07:12 PM   #6
paragn
Member
 
Registered: Jan 2006
Distribution: Red Hat EL5, Fedora 7
Posts: 259

Rep: Reputation: 30
Yes i have used it its great tool for command line users
 
Old 03-27-2006, 04:54 AM   #7
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
Thank you! I can't find any tutorial about how to #include ImageMagick and GCC. Can anyone give me any link or something, I have searched in google, but I can't find anything!!!
 
Old 03-27-2006, 09:14 AM   #8
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
As far as I understood, ImageMagick is like command line image manipulation app, and all I can do with it in C is system("...");??? so it isn't posible to use it in C as a librarie?
 
Old 03-27-2006, 10:53 AM   #9
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Graemef already gave you a link (he gave you two links, in fact: one to Image Magick, the other to GD2).

Several people have already explained to you that ImageMagick is *BOTH* a library (callable from C, Python, Perl and other languages) *AS WELL AS* a set of command line tools (which you can invoke from a shell script or a .bat file).

Now please re-read the previous posts: they should answer your questions.
 
Old 03-27-2006, 03:37 PM   #10
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks, but I can't find a single tutorial about using ImageMagick in GCC!!
 
Old 03-27-2006, 05:49 PM   #11
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Sigh...

Here are some links that I found helpful:

http://www.imagemagick.org/script/magick-core.php
http://www.graphicsmagick.org/www/api/types.html
http://www.graphicsmagick.org/www/ap...ireimagepixels
http://www.graphicsmagick.org/www/api/types.html#Image
http://www.aerophile.org/ImageMagick...2image_8h.html
http://www.aerophile.org/ImageMagick...antize_8c.html
http://library.n0i.net/linux-unix/ap...k/www/api.html

Here's cut/paste of a simple ImageMagick "Hello world":
Code:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <magick/api.h>

int
main (int argc, char *argv[])
{
  // Check arguments
  if (argc < 2)
  {
    printf ("USAGE: psm060203a <*.png files list>\n");
    return 1;
  }

  // Init ImageMagic
  InitializeMagick(argv[0]);
  ...
  // Cleanup ImageMagic
  printf ("Closing ImageMagick...\n");
  if (images)
    DestroyImages (images);
  if (image_info)
    DestroyImageInfo(image_info);
  DestroyMagick();

  return 0;
}
 
Old 03-28-2006, 08:12 AM   #12
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
Thank you very much!!
 
Old 03-28-2006, 08:22 AM   #13
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
I've used Imlib2 on a number of occasions and like it. You can find documentation and stuff on the enlightenment site (www.enlightenment.org ?).
 
  


Reply



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
command line image manipulation (imagemagick?) exodist Linux - Software 3 03-13-2006 01:35 PM
console background image? - no X, just console jgams Slackware 2 12-06-2005 08:56 PM
Batch image manipulation elfoozo Linux - Software 5 06-03-2005 06:22 PM
[C/C++] Image manipulation Cornholio Programming 2 03-06-2005 11:46 AM
image manipulation/analysis library : recommandation ? bahramH Linux - Software 0 05-26-2004 09:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration