Divide_vert script help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
eleison
Posts: 45
Joined: 2013-12-10T15:14:46-07:00
Authentication code: 6789

Divide_vert script help

Post 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!
eleison
Posts: 45
Joined: 2013-12-10T15:14:46-07:00
Authentication code: 6789

Re: Divide_vert script help

Post 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?
eleison
Posts: 45
Joined: 2013-12-10T15:14:46-07:00
Authentication code: 6789

Re: Divide_vert script help

Post 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...
eleison
Posts: 45
Joined: 2013-12-10T15:14:46-07:00
Authentication code: 6789

Re: Divide_vert script help

Post 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!?
Post Reply