Greyscale + gaussian
Posted: 2011-07-24T14:29:52-07:00
Hey guys,
I'm looking to have a nip2 routine switched over to another image lib. I'd like to switch over to ImageMagick, since this prog seems easier to implement server-side and somewhat faster as well. With this being my first confrontation with ImageMagick, I'd like to as you guys for some help. I've been all over the docs and searched this forums/google all I could. Eventually, I'm still stuck on some parts. Hopefully you can help me out.
I'm implementing this script server side inside a php class.
These are the implementations I need:
* convert from 1 bit to 8 bit greyscale
* gaussian filter with radius 20
* rescale the gray levels (x3 or autolevel)
* threshold at 40 -> revert to binary image
* do a 5px cropping of the edges
This is what I have so far:
The 'evaluate multiply 16 -depth8' method is something I found in a forum thread in here. Not sure if it applies to what I'm trying to do. It's the only part that seems to work though. When I run that command line, it errors (produces no output). When I remove the blur and the threshold, it gives me an output, but not quite what I was expecting. It seems the gaussian blur is causing the error. Am I using the wrong syntax? Any help is welcome, thanks
I'm looking to have a nip2 routine switched over to another image lib. I'd like to switch over to ImageMagick, since this prog seems easier to implement server-side and somewhat faster as well. With this being my first confrontation with ImageMagick, I'd like to as you guys for some help. I've been all over the docs and searched this forums/google all I could. Eventually, I'm still stuck on some parts. Hopefully you can help me out.
I'm implementing this script server side inside a php class.
These are the implementations I need:
* convert from 1 bit to 8 bit greyscale
* gaussian filter with radius 20
* rescale the gray levels (x3 or autolevel)
* threshold at 40 -> revert to binary image
* do a 5px cropping of the edges
This is what I have so far:
Code: Select all
exec("convert input.png -evaluate multiply 16 -depth 8 -gaussian-blur 20 -white-threshold 40 output.png");