scaling on black and white images
Posted: 2014-10-21T03:48:28-07:00
a quick background of my problem: I am trying to separating lines with text from many black and white images with different dimensions.
In IM's divide_vert script, There is a comment:
# SPEEDUP
# If your input image uses a white background one way of speeding up this
# process is to simply compress (-scale) the image directory down to a
# single column. Any pixel that remains white will then represent a blank
# row of pixels. That would be a major speed increase, but only for
# images with a pure-white (or pure-black) background.
http://www.imagemagick.org/Usage/scripts/divide_vert
Can someone explain why and how the speedup realized? How can I use it?
I have tried -scale and -resize with same percentage and they seems to generate same image.
convert bw.bmp -scale '50%' bw_scaled.bmp
bw_scaled.bmp BMP 384x288 384x288+0+0 8-bit sRGB 332KB 0.000u 0:00.000
In IM's divide_vert script, There is a comment:
# SPEEDUP
# If your input image uses a white background one way of speeding up this
# process is to simply compress (-scale) the image directory down to a
# single column. Any pixel that remains white will then represent a blank
# row of pixels. That would be a major speed increase, but only for
# images with a pure-white (or pure-black) background.
http://www.imagemagick.org/Usage/scripts/divide_vert
Can someone explain why and how the speedup realized? How can I use it?
I have tried -scale and -resize with same percentage and they seems to generate same image.
convert bw.bmp -scale '50%' bw_scaled.bmp
bw_scaled.bmp BMP 384x288 384x288+0+0 8-bit sRGB 332KB 0.000u 0:00.000