Blur

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
jupiter
Posts: 28
Joined: 2011-11-17T07:45:55-07:00
Authentication code: 8675308

Blur

Post by jupiter »

I've tried several different methods and parameters now.

but the code:

Image image( "100x100", "white" );
image.read("test.jpg");
image.blur(6.0, 1.5);
image.write( "test123.jpg" );

doesn't change the image at all.

what am i doing wrong?

thanks in advance
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Blur

Post by fmw42 »

I don't know much about the Magick++ API, so your problem may be with how you are coding it.

However, try leaving the radius=0 and just change the sigma. IM will compute the appropriate radius. note the radius that it computes will be about 3x sigma
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Blur

Post by magick »

Works for us. We're using ImageMagick 6.7.3-6 and this code:

Code: Select all

// g++ `Magick++-config --cxxflags --cppflags` -O2 -Wall -o magick magick.cpp `Magick++-config --ldflags --libs`
#include <Magick++.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
using namespace Magick;

int main(int argc, char **argv)
{
  Image image( "100x100", "white" );
  image.read("test.jpg");
  image.blur(6.0, 1.5);
  image.write( "test123.jpg" );
}
jupiter
Posts: 28
Joined: 2011-11-17T07:45:55-07:00
Authentication code: 8675308

Re: Blur

Post by jupiter »

well i don't get it to work.

is the blur effect then directly written into the image? so writing the image should write the blurred image to disc right?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Blur

Post by magick »

Correct. We get a blurred image.
jupiter
Posts: 28
Joined: 2011-11-17T07:45:55-07:00
Authentication code: 8675308

Re: Blur

Post by jupiter »

actually i don't. it looks the same as the original image. but binary data is different
jupiter
Posts: 28
Joined: 2011-11-17T07:45:55-07:00
Authentication code: 8675308

Re: Blur

Post by jupiter »

could you provide me you prebuilt lib? just in case i did something wrong with compiling it myself. i still don't get a blurred image, and shadow doesn't work neither.
Post Reply