Page 1 of 1

How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-11T00:34:39-07:00
by djshin
Hi, everyone!!

We upgraded the version of ImageMagic on unix machine from 5.2 to 6.4.5 last month.
I used the function "ScaleImage(image, scaled_x, scaled_y, &exception)".

When I used the 5.2 version I could get fine image after resizing 'jpg to jpg' or 'tiff to tiff',
but when I used the 6.4 version the quality of result image was very poor.

So, we changed the source code to get a fine image like below,
1. convert source image(.jpg or .tiff) to ".bmp" image
2. resize bmp image to target image(.jpg or .tiff)

We could get a fine image but this way takes too much system loads especially disk I/O and takes very long time to change image.

How can I get a fine image after resizing by 6.4.5 version with less system loads?

I want to know how to resize image without bmp conversion and quality loss.

Re: How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-15T19:21:39-07:00
by anthony
Try increasting -quality level for JPEG compression.


What do you mean by 'fine image'????

Re: How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-17T02:54:29-07:00
by djshin
anthony wrote:Try increasting -quality level for JPEG compression.


What do you mean by 'fine image'????
Thanks for your answer!!
I visited example site, and found that you also have a trouble to resize line drawings.
What I do is resizing line drawings.

I tried lots of different options to success, but I failed for every trial.
Can you show me what was the best options to resize line drawings from your experiences.

Thank you!!

Re: How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-17T12:05:34-07:00
by fmw42
can you post an example?

Re: How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-17T20:27:23-07:00
by djshin
fmw42 wrote:can you post an example?
This is the original TIF image that I want to resize smaller than original image 50%.

http://mfiles.naver.net/64b551859fc3a91 ... gghost.tif


Thanks.

Re: How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-17T21:53:28-07:00
by anthony
I downloaded it so it is present now.

Hmm yes a line drawing.

I think the best way may be to try and thicken the lines a bug first.

For example
convert jtest-egghost.tif -blur 1x65000 -threshold 80% \
-resize 50% smaller_line_drawing.tif

for squarer corners change the threshold to 99% or 99.999%
(do not use 100%!)

This operation is a but like a 'morphological' binary operation of 'erode' with a 9x9 square neighborhood. That is any pixel that has a black neighbor is to be set to black, thus thickening the lines by two pixels.

Re: How can I get a fine image after image resizing with v6.4.5?

Posted: 2008-12-18T11:58:15-07:00
by fmw42
djshin wrote:
fmw42 wrote:can you post an example?
This is the original TIF image that I want to resize smaller than original image 50%.

http://mfiles.naver.net/64b551859fc3a91 ... gghost.tif


Thanks.

Seems I cannot download this file. But as Anthony mentioned you can thicken the lines before reducing the size. You can do as he suggests or you can try my morphology script at http://www.fmwconcepts.com/imagemagick/index.html with several iterations of erode if the lines are black on white background or dilate if white lines on black background.