Hello...
with commandline on WinXP I got very slow response.
The test.tif is rather big. it's 4437x6580 and action takes 25 second to finish.
The commandline....
convert test.tif -chop 3x4! -monitor -colorspace gray -white-threshold 1 -depth 1 out.tif
And what I wan't to do.
The tiff is realy output from scantailor. And it has black text and images in some place. The images can be grayscale or color.
With that commandline I want to do folowing.
crop size to be divisible with some numbers (ie to have integers at 600dpi and 100dpi from same image)
then I wan't to get just bacground and black color (text) in output tiff with 1bpp.
The result is what I want.
similar command takes 9 seconds
convert testcolor.tif -chop 3x4! -monitor -fill white -opaque black -depth 8 -resample 100 x03.ppm
and should do just oposite. It's make black transparent(white) and save with lowered resoluiton.
intention is to make good djvu. And need separate file for foreground and background.
thanks
convert is so slow!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert is so slow!
try saving to png or some other format to test if it is the tiff writer being slow or just the size of your image and perhaps not enough memory and thrashing to disk.The test.tif is rather big. it's 4437x6580 and action takes 25 second to finish.
The commandline....
convert test.tif -chop 3x4! -monitor -colorspace gray -white-threshold 1 -depth 1 out.tif
Re: convert is so slow!
Hello.
I tried few other file format's.
The result is wery strange for me. The output format has wery little impact on time. The difference is few seconds. The tif seems to be fastest and ppm is slowest. (seems to be proportional with output file size).
But what surprise me is that that input file format has enormous impact. Same input file just converted to ppm take over minute and half!
I test to resize image by half in x&y. Si image is 1/4 of size. the processing time is near exact 1/4 time of original. As that file is short I can guarante that is not swaped to disk. Either in big file the HDD LED doesn't blink when conversion is in progress. So I assume it's run from ram. (I have just 1GB of ram but system manager show's that image processing took aprox 200k of memory)
the switch -depth 1 is that one that cause slow work. Without that image processing is fast (6 seconds) but of course image is wrong.
I tried few other file format's.
The result is wery strange for me. The output format has wery little impact on time. The difference is few seconds. The tif seems to be fastest and ppm is slowest. (seems to be proportional with output file size).
But what surprise me is that that input file format has enormous impact. Same input file just converted to ppm take over minute and half!
I test to resize image by half in x&y. Si image is 1/4 of size. the processing time is near exact 1/4 time of original. As that file is short I can guarante that is not swaped to disk. Either in big file the HDD LED doesn't blink when conversion is in progress. So I assume it's run from ram. (I have just 1GB of ram but system manager show's that image processing took aprox 200k of memory)
the switch -depth 1 is that one that cause slow work. Without that image processing is fast (6 seconds) but of course image is wrong.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert is so slow!
If you are thresholding, you likely don't need -depth 1 as thresholding causes a binary result anyway. But if it does not, just put -type bilevel rather than -depth 1.
Re: convert is so slow!
Hello...
I need 1bpp output file for next step.
Thanks for help.
I need 1bpp output file for next step.
Thanks for help.
Re: convert is so slow!
If there is not enough memory available, image pixels are cached to disk rather than memory which can be quite slow. You can reduce memory requirements by downloading the Q8 version of ImageMagick. The default is Q16 (16-bits per pixel). We tried your command with ImageMagick 6.7.2-2 and it completed in less than 4 seconds.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert is so slow!
GM is probably using a much simpler resampling/filter method than IM. Try using -scale rather than -resize (or -filter point -resize ... or -filter triangle -resize ...)
Did you try removing the -depth 1 or change it to -type bilevel (with -threshold you should not need either).
Did you try removing the -depth 1 or change it to -type bilevel (with -threshold you should not need either).
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: convert is so slow!
GM was also a fork before the filter re-programming I undertook. As such some filters (such as BlackMan) are simply wrong. The reason for the re-programming was so that 'cylindrical filters' were available using image distortions, so GM does not have that operation either. So no Distort Resize variation!
http://www.imagemagick.org/Usage/resize/#distort_resize
http://www.imagemagick.org/Usage/resize/#distort_resize
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/