Page 1 of 1

Divide_vert script help

Posted: 2014-12-17T07:58:50-07:00
by eleison
I'm using this script: http://www.imagemagick.org/Usage/scripts/divide_vert

It works great! It divides the image I got in to segments and removes the white space in between the pixels I want to keep. I got a black and white image with a white background and with some black segments.

My black segments are not solid black, so first I do a -blur on the image to get solid black areas, then I divide the image with the script. But I want to divide the orignal image not the blurred one. How do I use a blurred image as input image but get the orignal image as output?

Thanks for any help!

Re: Divide_vert script help

Posted: 2014-12-17T08:17:15-07:00
by eleison
I found this:
http://www.imagemagick.org/Usage/scripts/divide_vert_bg

And it seems better fit for my purpose. In one of the comments within the script it says:
# ----------------------------------------------------------------------
# The problem is we need to know the height of the image to scale it!
# If it wasn't for this we would not need any temporary files at all.

I know the height of the image, so how do I improve the performance further?

Re: Divide_vert script help

Posted: 2014-12-17T08:27:58-07:00
by eleison
Can't get the divide_vert_bg to work.

This is what i'm using:

Code: Select all

divide_vert_bg.sh -i -b white blur.jpg result.jpg
It outputs a result.jpg but still with white space...

Re: Divide_vert script help

Posted: 2014-12-17T08:51:27-07:00
by eleison
I found the answer on my first question:
I changed line 166:
From
convert $tmpdir/original.mpc -crop 0x$h+0+$top +repage $file
to
convert image.jpg -crop 0x$h+0+$top +repage $file

Which works for me...

So know I'm interested to get this to work on the vert_bg version!?